Hi,
I have a custom AEM endpoint returning some json content. In some cases when there is some content related issue, I would like to return a 500 with a custom json body. It is working good on my local but when running the same on cloud it is displaying an AEM error page with the text "Unexpected Error: Looks like we are having some issues with our service. We are working hard to bring it online again.".
How could I configure AEM / dispatcher so that it just simply displays the content I send in my response? I have found several documents / entries on creating custom error pages (tried to set e.g. DispatcherPassError) but no luck.
So is there a way to return the response of my /bin/.... endpoint as it is to the client on cloud? The same is working with e.g. 404 error code.
Thanks,
Peter
Solved! Go to Solution.
hi @pnagy,
You can try setting the response header x-aem-error-pass=true, as outlined in the documentation.
hi @pnagy,
You can try setting the response header x-aem-error-pass=true, as outlined in the documentation.
Thanks @giuseppebag, it is working as expected.
I missed that, exactly what I was looking for.
Views
Replies
Total Likes
To ensure your custom JSON error is returned and not replaced by an AEM error page:
-Set Dispatcher to pass errors for your endpoints.
-Avoid AEM's default error handling for that path by ensuring all logic/output is handled in your servlet.
Views
Replies
Total Likes
Views
Likes
Replies