Skip to content

Unexpected token e in JSON at position 0 #25

@TrevHeath

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions