Avoid throws Exception where possible - Phase I

* Polishing - PR Comments
This commit is contained in:
Gary Russell
2019-03-07 12:53:52 -05:00
committed by Artem Bilan
parent 005bc80680
commit b187bca36e
130 changed files with 992 additions and 784 deletions

View File

@@ -27,6 +27,7 @@ import org.springframework.integration.websocket.IntegrationWebSocketContainer;
import org.springframework.integration.websocket.support.PassThruSubProtocolHandler;
import org.springframework.integration.websocket.support.SubProtocolHandlerRegistry;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.messaging.converter.ByteArrayMessageConverter;
import org.springframework.messaging.converter.CompositeMessageConverter;
import org.springframework.messaging.converter.DefaultContentTypeResolver;
@@ -136,7 +137,7 @@ public class WebSocketOutboundMessageHandler extends AbstractMessageHandler {
}
@Override
protected void handleMessageInternal(Message<?> message) throws Exception { // NOSONAR
protected void handleMessageInternal(Message<?> message) {
String sessionId = null;
if (!this.client) {
sessionId = this.subProtocolHandlerRegistry.resolveSessionId(message);
@@ -166,6 +167,9 @@ public class WebSocketOutboundMessageHandler extends AbstractMessageHandler {
logger.error("Exception terminating session id '" + sessionId + "'", secondException);
}
}
catch (Exception e) {
throw new MessageHandlingException(message, "Failed to handle", e);
}
}
}