Hello guys, I have a question regarding exception ...
# ktor
t
Hello guys, I have a question regarding exception handling in ktor. As some of you know to handle REST exception, we generally use @ControllerAdvice and @ExceptionHandler in Spring MVC but these handler works if the request is handled by the DispatcherServlet. However, security-related exceptions occur before that as it is thrown by Filters. How does the exception handler work in ktor? Is it a single point exception handler
Copy code
try{
   smth
} catch(Throwable t) {
   smth
}
that handles everything or it should be done separately for each case like in the spring security? Thanks
a
You can use the StatusPages plugin to catch any exceptions.
t
okay, thanks