0

A nodejs application, which uses a library I've written throws an error like this:

{
  "error": {
    "code": 500,
    "message": "SyntaxError: Unexpected token \r",
    "debug": "536585744307add1ab4e847288a0a3fb4a5cb4a73c1836a14ab98a026fc1f9315125443b33a07f1e60f7a3fea20f064bda848b6aba8bfb7a0b8c8aa8cd5e5b355815f93c1ed0366696909ab2aebdb98343ca4d2f11e9e2b9f0bcfef7e8b8b5a7d7335308"
  }
}

In this example I've replaced the content of debug with random hexadecimal numbers, in the real scenario, there are over 3000 characters.

Unfortunately I can't get my hands on the whole application, so I wanted to know if that is in some configuration a default behaviour by nodejs and how I might be able to read the content of debug.

Update:

It might not have been obvious, but it's an HTTP 500 error. The application uses ExpressJS and the tests were executed with Postman.

peter
  • 14,348
  • 9
  • 62
  • 96
  • Is the hexa of the actual error just gibberish when translated to ASCII/Unicode or is it a format issue? – Kyll Aug 31 '15 at 09:40
  • the quick online converter I've found only returned gibberish (http://www.rapidtables.com/convert/number/hex-to-ascii.htm) – peter Aug 31 '15 at 09:43
  • This is application-specific, I'm not aware of any Node.js internals that would use this. – robertklep Aug 31 '15 at 10:13
  • ok thx. I just saw that I've forgotten to mention, that it's an express-based application and the error is a HTTP 500 error due to an internal SyntaxError. But maybe it was already clear for you based on the error code 500. – peter Aug 31 '15 at 10:20
  • @Peter my guess is that the app is using a custom error handler to generate the error _and_ add the `debug` property (perhaps some sort of identifier to trace the error in an external system, although 3K sounds rather large for that; perhaps it's a compressed document of some sorts?) – robertklep Aug 31 '15 at 10:28
  • I thought it would be some JSON document. it should be roughly 1.6KB. I've tried converting it to a binary file with `echo -e` as described here: http://stackoverflow.com/questions/1604765/linux-shell-scripting-hex-string-to-bytes but either I failed, or it isn't a gzip or bzip2 compatible file format - the file starts with `1f cc c7` which doesn't seem to be any well known file format, given the lists http://www.garykessler.net/library/file_sigs.html and https://en.wikipedia.org/wiki/List_of_file_signatures – peter Aug 31 '15 at 10:46

0 Answers0