Free Support Forum -

Exception handling issue



I need a way to handle the exceptions thrown from various methods. In my case the session (HTTP session) may expire at any point and then the the viewer seems not usable but at the same time it doesn’t show any issue, e.g. when page cannot be loaded (getDocumentPageImageHandler throws an exception). I need way to notify user that the session has expired. I need a popup message displaying the exception message and also some way to handle that exception in the JSP page (e.g. reload, use SSO to re-authenticate that user, etc).

Without that users will very ofter run into that issue wihout knowing what is going on. Exception is printed only to the app server log.


Hello Mariusz,

Thank you for your request. You can handle exceptions and show the popup message via this code that is included in our Spring sample:

return writeOutputJson(toJson(new StatusResult(false, e.getMessage())));

As you can see on the screenshot the popup message is shown in the handler LIST_ANNOTATIONS_HANDLER.

The frontend in the GroupDocs.Annotation and the GroupDocs.Viewer is responsible for displaying messages. In case of the getDocumentPageImageHandler the popup message will not be shown, because this handler is a final request and it cannot hand off any result in the frontend.

In the next releases we are planning to improve a functionality displaying messages and it will be possible at the backend part.

If you will have more questions, please do not hesitate to contact us.

Best regards
Evgen Efimov
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+