Get CustomException: null when throw CustomException in EventListener

21 views Asked by At

I have CustomException and a class with @RestControllerAdvice. when i call an API and get Exception RestControllerAdvice catch my Exception (debug goes in the exception handler method) and show the message in console but when i throw CustomException inside @Scheduled or @EventListener(ApplicationReadyEvent.class) , RestControllerAdvice cannot catch my exception and show null in console:

com.company.utility.exception.CustomException: null
0

There are 0 answers