Exception Handling in Spring Boot WebFlux Reactive REST Web Services

#ICYDK: This is a continuation of our series on exception handling and validation in Spring Boot REST APIs. In earlier posts, we discussed a robust pattern for exception handling and validation in Spring Boot and MVC REST Web Services. Please go through that first if you have not already. To summarize, we recommended coding an ErrorComposer to compose errors from exception objects, which could be used in a controller advice as well as a custom error controller. The controller advice would catch exceptions bubbling up from your controllers, whereas the error controller would be the ultimate weapon for handling exceptions raised at all levels, e.g. in filters.

However, in WebFlux, Spring Boot provides a WebExceptionHandler filter instead of the error controller. So, instead of providing your custom error controller and error attributes, you would need to provide a custom WebExceptionHandler and/or  ErrorAttributes. For more details, refer to Spring Boot documentation. https://goo.gl/gZ67QA #DataIntegration #ML

Subscribe To Newsletter

Sign up for my newsletter and get the latest technology news

2019 © Craig Brown PhD. All rights reserved.