Skip to content

Unexpected token e in JSON at position 0 #25

Description

@TrevHeath

Certain errors in the SDK are uncatchable. This was especially noticeable today during the outage. Even if we wrap in a try catch and attempt to gracefully handle, we received:

{"errorType":"SyntaxError","errorMessage":"Unexpected token e in JSON at position 0","stack":["SyntaxError: Unexpected token e in JSON at position 0","    at JSON.parse (<anonymous>)","    at IncomingMessage.<anonymous> (/var/task/node_modules/@dopplerhq/node-sdk/dist/index.cjs:679:24)","    at IncomingMessage.emit (node:events:529:35)","    at endReadableNT (node:internal/streams/readable:1400:12)","    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)"]}

This also happens every once in a while while the service is up, I assume it is a 500 error without a JSON being returned. Any solutions for this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions