Have you looked at your rewriter too? Maybe the 401 is for the rewriter, not the error handler?
Another clue might come from the AccessLog for that app server. -Danny From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Rahul Gupta Sent: Tuesday, July 28, 2015 9:55 AM To: general@developer.marklogic.com Subject: [MarkLogic Dev General] ML 8 Error Handler Non-Execution | Unauthorized User Hi, I am currently migrating my ML 6.0-5.3 code to ML 8.0-3 and I found that error-handler for the App-server is not being executed when an unauthorized user logs in. I did some research and came to this link: https://docs.marklogic.com/guide/app-dev/appserver-control#id_84264 But this link has no change as compared to ML 6 documentation and it was doing custom error handling for an unauthorized-user. https://docs.marklogic.com/6.0/guide/app-dev/appserver-control#id_84264 [cid:image001.png@01D0C926.73134F90] And in error-handler.xqy, it is written like as follows: let $error as element(e:error) := if ( fn:exists($error:errors) ) then local:handle-thrown-exception() else local:handle-general-error() Also, the app-server default user is assigned with admin role and default error format in ML 8 as "xml" tried using "html, json, compatible". Hence it has the execute permissions too. Still Not working... Can anyone please suggest how to throw custom message for an unauthorized user from the error handler mechanism. Currently I am getting is: <error-response xmlns='http://marklogic.com/xdmp/error'> <status-code>401</status-code> <status>Unauthorized</status> <message>401 Unauthorized</message> </error-response> Thanks, Rahul
_______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general