Hi, Danny:

There isn't a way to customize standard error handling.

That said, I'm surprised that you're seeing a long response.  When I try, the 
total content of the error response is:

{"errorResponse":{"statusCode":404, "status":"Not Found", 
"messageCode":"RESTAPI-NODOCUMENT", "message":"RESTAPI-NODOCUMENT: 
(err:FOER0000) Resource or document does not exist:  category: content message: 
/not/there.json"}}

And the total content of the error log at info level is:

Info: App-Services: Status 500: RESTAPI-NODOCUMENT: (err:FOER0000) Resource or 
document does not exist:  category: content message: /not/there.json

Do you see the large output in the response or the log?  If the latter, is it 
possible you have logging set to debug or more fine grained?


Erik Hennum

________________________________
From: [email protected] 
[[email protected]] on behalf of Danny Sinang 
[[email protected]]
Sent: Wednesday, July 08, 2015 5:06 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Custom Error Handling for REST API call

Hi Raja,

Are you suggesting I create a resource extension instead and use fn:errorr() as 
described on that page ? If so, then yes, I believe that would be one solution.

However, I'm curious to see if there's a way to do custom error handling for 
the standard GET/v1/documents call. The doc at 
https://docs.marklogic.com/8.0/REST/GET/v1/documents doesn't seem to mention 
any way to do so.

Regards,
Danny


On Wed, Jul 8, 2015 at 7:52 AM, 
<[email protected]<mailto:[email protected]>> 
wrote:
Hi Danny ,

Did u check the below mentioned section in the REST API [extensions] document .

https://docs.marklogic.com/guide/rest-dev/extensions#id_33892


thanks and regards
Raja >>>

From: 
[email protected]<mailto:[email protected]>
 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Danny Sinang
Sent: Wednesday, July 08, 2015 4:26 PM
To: general
Subject: [MarkLogic Dev General] Custom Error Handling for REST API call

Is there a way to make the ML REST API on ML 8 do custom error handling ?

Right now, when we issue a request like this (for a non-existent document) :

GET /v1/documents/?uri=/1211/20/14/IC12112014.xml

We get a long (15 to 20-line) error message that starts off like this :


RESTAPI-NODOCUMENT: (err:FOER0000) Resource or document does not exist:  
category: content message: /1211/20/14/IC12112014.xml

     ...



I'm hoping I could just replace the error message with a custom one-liner.



Regards,

Danny





This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful. Where permitted by applicable law, this e-mail 
and other e-mail communications sent to and from Cognizant e-mail addresses may 
be monitored.

_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general


_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to