how to get sling servlet response-AEMasCS
Hi Team,
I was trying to redirect error response to 500.html,when we gave incorrect url as below.
please find the json error response.
{
"errors": [
{
"message": "Exception while fetching data (/bauPopupMainSecByPath) : Path: '/content1/dam/cfm-cere/bau-consumer/elife/additional-benefits/popup/benefits-main-sec' did not yield a Content Fragment",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"bauPopupMainSecByPath"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": null
}
Please find the Java code here

Kindly please help how to redirect by getting error response and redirect to 500.html