Using @ControllerAdvice we can create a global exception handler but not sure how to handle the following
1. Throw error and stays in the same page in some cases
2. Throws error and redirect to an error page in some cases
#1 - not sure how it is possible as the page should not be re-loaded fully. The user might have encountered a error on the internal form in a page. We are doing ajax calls.