ML Support has now filed this bug report :

#34441 - Rest API: 404 error generates a long stack trace in the error log.


On Thu, Jul 9, 2015 at 3:32 AM, <[email protected]> wrote:

>  Hi Danny ,
>
>
>
> Me too tested the same scenario , Yes, its look like bug only , the error
> message generated two times for single [GET Method] hit.
>
>
>
> Thanks and regards
>
> Raja >>>
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Danny Sinang
> *Sent:* Wednesday, July 08, 2015 8:10 PM
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] Custom Error Handling for REST API
> call
>
>
>
> Come to think of it, yeah, it is a bug.
>
>
>
> Will now file a bug report to ML support.
>
>
>
> Turns out each call for a non-existent document generates not 20, but 316
> lines in ErrorLog.txt.
>
>
>
> Regards,
>
> Danny
>
>
>
> On Wed, Jul 8, 2015 at 10:27 AM, Erik Hennum <[email protected]>
> wrote:
>
> Hi, Danny:
>
> Thanks for clarifying.
>
> The case could be made that it is a bug for a 404 to generate a stack
> trace in the error log (even at debug level).
>
>
>
> Erik Hennum
>     ------------------------------
>
> *From:* [email protected] [
> [email protected]] on behalf of Danny Sinang [
> [email protected]]
> *Sent:* Wednesday, July 08, 2015 7:19 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] Custom Error Handling for REST API
> call
>
> Sorry, I should have mentioned that the long error message I'm seeing is
> in ErrorLog.txt and the File Logging Level is Debug.
>
>
>
> Regards,
> Danny
>
>
>
> On Wed, Jul 8, 2015 at 8:53 AM, Erik Hennum <[email protected]>
> wrote:
>
> 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]> 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]] *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]
> 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
>
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
>  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]
> 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