ehmad11 / netsuite-rest

Make requests to Oracle NetSuite REST Web Services.
MIT License
49 stars 20 forks source link

Expose more info when there is an error #26

Open julbrs opened 1 year ago

julbrs commented 1 year ago

Hi,

When an error is occuring a NS call, I am ending with a very basic error generated by got. (like HttpError 400).

I think it's linked to this! https://github.com/sindresorhus/got/issues/1126

I would like to have a bit more information like what I can see in Postman:

{
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title": "Bad Request",
    "status": 400,
    "o:errorDetails": [
        {
            "detail": "Error while accessing a resource. Please enter value(s) for: First Name, Last Name.",
            "o:errorCode": "USER_ERROR"
        }
    ]
}