diff --git a/src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java b/src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java index 97958bb..31f9ab8 100644 --- a/src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java +++ b/src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java @@ -43,7 +43,7 @@ class JsonSupportWrapper implements JsonSupport { } catch (Exception e) { src.reset(); log.error("Can't read ack args: " + src.readLine() + " for type: " + callback.getResultClass(), e); - return null; + throw new IOException(e); } } @@ -53,7 +53,7 @@ class JsonSupportWrapper implements JsonSupport { } catch (Exception e) { src.reset(); log.error("Can't read value: " + src.readLine() + " for type: " + valueType, e); - return null; + throw new IOException(e); } } @@ -62,6 +62,7 @@ class JsonSupportWrapper implements JsonSupport { delegate.writeValue(out, value); } catch (Exception e) { log.error("Can't write value: " + value, e); + throw new IOException(e); } } diff --git a/src/main/java/com/corundumstudio/socketio/handler/InPacketHandler.java b/src/main/java/com/corundumstudio/socketio/handler/InPacketHandler.java index 0cebe83..05fa401 100644 --- a/src/main/java/com/corundumstudio/socketio/handler/InPacketHandler.java +++ b/src/main/java/com/corundumstudio/socketio/handler/InPacketHandler.java @@ -93,7 +93,7 @@ public class InPacketHandler extends SimpleChannelInboundHandler } catch (Exception ex) { String c = content.toString(CharsetUtil.UTF_8); log.error("Error during data processing. Client sessionId: " + client.getSessionId() + ", data: " + c, ex); - return; + throw ex; } } } diff --git a/src/main/java/com/corundumstudio/socketio/listener/DefaultExceptionListener.java b/src/main/java/com/corundumstudio/socketio/listener/DefaultExceptionListener.java index 15b1969..d5f5018 100644 --- a/src/main/java/com/corundumstudio/socketio/listener/DefaultExceptionListener.java +++ b/src/main/java/com/corundumstudio/socketio/listener/DefaultExceptionListener.java @@ -43,16 +43,6 @@ public class DefaultExceptionListener extends ExceptionListenerAdapter { log.error(e.getMessage(), e); } - @Override - public void onMessageException(Exception e, String data, SocketIOClient client) { - log.error(e.getMessage(), e); - } - - @Override - public void onJsonException(Exception e, Object data, SocketIOClient client) { - log.error(e.getMessage(), e); - } - public boolean exceptionCaught(ChannelHandlerContext ctx, Throwable e) throws Exception { log.error(e.getMessage(), e); return true; diff --git a/src/main/java/com/corundumstudio/socketio/listener/ExceptionListener.java b/src/main/java/com/corundumstudio/socketio/listener/ExceptionListener.java index cbad76e..8d50038 100644 --- a/src/main/java/com/corundumstudio/socketio/listener/ExceptionListener.java +++ b/src/main/java/com/corundumstudio/socketio/listener/ExceptionListener.java @@ -29,10 +29,6 @@ public interface ExceptionListener { void onConnectException(Exception e, SocketIOClient client); - void onMessageException(Exception e, String data, SocketIOClient client); - - void onJsonException(Exception e, Object data, SocketIOClient client); - boolean exceptionCaught(ChannelHandlerContext ctx, Throwable e) throws Exception; } diff --git a/src/main/java/com/corundumstudio/socketio/listener/ExceptionListenerAdapter.java b/src/main/java/com/corundumstudio/socketio/listener/ExceptionListenerAdapter.java index 0faa156..89efc0f 100644 --- a/src/main/java/com/corundumstudio/socketio/listener/ExceptionListenerAdapter.java +++ b/src/main/java/com/corundumstudio/socketio/listener/ExceptionListenerAdapter.java @@ -40,14 +40,6 @@ public abstract class ExceptionListenerAdapter implements ExceptionListener { public void onConnectException(Exception e, SocketIOClient client) { } - @Override - public void onMessageException(Exception e, String data, SocketIOClient client) { - } - - @Override - public void onJsonException(Exception e, Object data, SocketIOClient client) { - } - @Override public boolean exceptionCaught(ChannelHandlerContext ctx, Throwable e) throws Exception { return false; diff --git a/src/main/java/com/corundumstudio/socketio/protocol/DecoderException.java b/src/main/java/com/corundumstudio/socketio/protocol/DecoderException.java deleted file mode 100644 index 487b75d..0000000 --- a/src/main/java/com/corundumstudio/socketio/protocol/DecoderException.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright 2012 Nikita Koksharov - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.corundumstudio.socketio.protocol; - -// TODO use SocketIOException -public class DecoderException extends RuntimeException { - - private static final long serialVersionUID = -312474299994609579L; - - public DecoderException(String message) { - super(message); - } - -}