001/*
002 * Copyright (C) 2015-2016 Neo Visionaries Inc.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package NeoVisionaries.WebSockets;
017
018
019/**
020 * WebSocket exception.
021 * 
022 * <EMBED CLASS='external-html' DATA-FILE-ID=LICENSE>
023 */
024public class WebSocketException extends Exception
025{
026    private static final long serialVersionUID = 1L;
027    private final WebSocketError mError;
028
029
030    public WebSocketException(WebSocketError error)
031    {
032        mError = error;
033    }
034
035
036    public WebSocketException(WebSocketError error, String message)
037    {
038        super(message);
039
040        mError = error;
041    }
042
043
044    public WebSocketException(WebSocketError error, Throwable cause)
045    {
046        super(cause);
047
048        mError = error;
049    }
050
051
052    public WebSocketException(WebSocketError error, String message, Throwable cause)
053    {
054        super(message, cause);
055
056        mError = error;
057    }
058
059
060    public WebSocketError getError()
061    {
062        return mError;
063    }
064}