update parser.js, add more explicit error message

it helps when debugging problems if you can figure out what the actual error was.