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