org.springframework.messaging.handler.annotation.MessageExceptionHandler Java Examples
The following examples show how to use
org.springframework.messaging.handler.annotation.MessageExceptionHandler.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TtyController.java From flow-platform-x with Apache License 2.0 | 5 votes |
@MessageExceptionHandler(AuthenticationException.class) public void onAuthException(AuthenticationException e) { TtyCmd.In in = (TtyCmd.In) e.getExtra(); TtyCmd.Out out = new TtyCmd.Out() .setId(in.getId()) .setAction(in.getAction()) .setSuccess(false) .setError(e.getMessage()); eventManager.publish(new TtyStatusUpdateEvent(this, out)); }
Example #2
Source File: XeChatController.java From xechat with MIT License | 5 votes |
/** * 消息异常处理 * * @param e 异常对象 * @param user 发送消息的用户对象 */ @MessageExceptionHandler(Exception.class) public void handleExceptions(Exception e, User user) { Code code = CodeEnum.INTERNAL_SERVER_ERROR; if (e instanceof ErrorCodeException) { code = ((ErrorCodeException) e).getCode(); } else { log.error("error:", e); } messageService.sendErrorMessage(code, user); }
Example #3
Source File: AnnotationExceptionHandlerMethodResolverTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler public void handleIllegalArgumentException(IllegalArgumentException exception) { }
Example #4
Source File: SimpleMessageListenerContainerTest.java From spring-cloud-aws with Apache License 2.0 | 4 votes |
@RuntimeUse @MessageExceptionHandler(RuntimeException.class) void handle() { // Empty body just to avoid unnecessary log output because no exception // handler was found. }
Example #5
Source File: QueueListenerTest.java From spring-cloud-aws with Apache License 2.0 | 4 votes |
@MessageExceptionHandler(RuntimeException.class) public void handle() { // Empty body just to avoid unnecessary log output because no exception // handler was found. }
Example #6
Source File: StompWebSocketIntegrationTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler @SendToUser("/queue/error") public String handleException(IllegalArgumentException ex) { return "Got error: " + ex.getMessage(); }
Example #7
Source File: AnnotationExceptionHandlerMethodResolverTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler public void handle() { }
Example #8
Source File: AnnotationExceptionHandlerMethodResolverTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler public String handle2(IllegalArgumentException ex) { return ClassUtils.getShortName(ex.getClass()); }
Example #9
Source File: WebSocketAnnotationMethodMessageHandlerTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler public void handleException(IllegalStateException ex) { this.exceptionHandled = true; }
Example #10
Source File: SimpleMessageListenerContainerTest.java From spring-cloud-aws with Apache License 2.0 | 4 votes |
@RuntimeUse @MessageExceptionHandler(RuntimeException.class) private void swallowExceptions() { }
Example #11
Source File: QueueMessageHandlerTest.java From spring-cloud-aws with Apache License 2.0 | 4 votes |
@MessageExceptionHandler(RuntimeException.class) public void handleException() { this.exceptionHandlerCalled = true; }
Example #12
Source File: MessageController.java From bearchoke with Apache License 2.0 | 4 votes |
@MessageExceptionHandler @SendToUser("/queue/errors") public String handleException(Throwable exception) { return exception.getMessage(); }
Example #13
Source File: GameManagementController.java From flex-poker with GNU General Public License v2.0 | 4 votes |
@MessageExceptionHandler @SendToUser("/queue/errors") public String handleException(Throwable exception) { return exception.getMessage(); }
Example #14
Source File: WebsocketSendToUserController.java From tutorials with MIT License | 4 votes |
@MessageExceptionHandler @SendToUser("/queue/errors") public String handleException(Throwable exception) { return exception.getMessage(); }
Example #15
Source File: MarketDataRSocketController.java From tutorials with MIT License | 4 votes |
@MessageExceptionHandler public Mono<MarketData> handleException(Exception e) { return Mono.just(MarketData.fromException(e)); }
Example #16
Source File: PortfolioController.java From spring4ws-demos with Apache License 2.0 | 4 votes |
@MessageExceptionHandler @SendToUser("/queue/errors") public String handleException(Throwable exception) { return exception.getMessage(); }
Example #17
Source File: SimpleMessageListenerContainerTest.java From spring-cloud-aws with Apache License 2.0 | 4 votes |
@RuntimeUse @MessageExceptionHandler(RuntimeException.class) void handle() { // Empty body just to avoid unnecessary log output because no exception // handler was found. }
Example #18
Source File: AnnotationExceptionHandlerMethodResolverTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler({BindException.class, IllegalArgumentException.class}) public String handle1(Exception ex) throws IOException { return ClassUtils.getShortName(ex.getClass()); }
Example #19
Source File: AnnotationExceptionHandlerMethodResolverTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler(SocketException.class) public void handleSocketException() { }
Example #20
Source File: AnnotationExceptionHandlerMethodResolverTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler(IOException.class) public void handleIOException() { }
Example #21
Source File: SimpAnnotationMethodMessageHandlerTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler(IllegalStateException.class) public void handleValidationException() { this.exceptionCaught = true; }
Example #22
Source File: SimpAnnotationMethodMessageHandlerTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler(IllegalStateException.class) public void handleValidationException() { this.exceptionCatched = true; }
Example #23
Source File: SimpAnnotationMethodMessageHandlerTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler(IllegalStateException.class) public void handleExceptionWithHandlerMethodArg(HandlerMethod handlerMethod) { this.method = "handleExceptionWithHandlerMethodArg"; this.arguments.put("handlerMethod", handlerMethod); }
Example #24
Source File: SimpAnnotationMethodMessageHandlerTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@MessageExceptionHandler(MethodArgumentNotValidException.class) public void handleValidationException() { this.method = "handleValidationException"; }
Example #25
Source File: AnnotationExceptionHandlerMethodResolver.java From spring4-understanding with Apache License 2.0 | 4 votes |
@Override public boolean matches(Method method) { return AnnotationUtils.findAnnotation(method, MessageExceptionHandler.class) != null; }
Example #26
Source File: WebSocketController.java From inventory-hub-java-on-azure with MIT License | 4 votes |
@MessageExceptionHandler public String handleException(Throwable exception) { messagingTemplate.convertAndSend("/errors", exception.getMessage()); return exception.getMessage(); }
Example #27
Source File: WebSocketAnnotationMethodMessageHandlerTests.java From java-technology-stack with MIT License | 4 votes |
@MessageExceptionHandler public void handleException(IllegalStateException ex) { this.exceptionHandled = true; }
Example #28
Source File: StompWebSocketIntegrationTests.java From java-technology-stack with MIT License | 4 votes |
@MessageExceptionHandler @SendToUser("/queue/error") public String handleException(IllegalArgumentException ex) { return "Got error: " + ex.getMessage(); }
Example #29
Source File: AnnotationExceptionHandlerMethodResolverTests.java From java-technology-stack with MIT License | 4 votes |
@MessageExceptionHandler public void handle() { }
Example #30
Source File: AnnotationExceptionHandlerMethodResolverTests.java From java-technology-stack with MIT License | 4 votes |
@MessageExceptionHandler public String handle2(IllegalArgumentException ex) { return ClassUtils.getShortName(ex.getClass()); }