Skip to content

400 errors cause crash #51

Open
Open
@tonybroadbent

Description

@tonybroadbent

If the gql request fails with a code 400, nothing appears in the node-red debug log. Syslog contains something like:
Node-RED[372]: 17 Aug 12:39:22 - [info] [graphql:Get Octopus] undefined
Node-RED[372]: (node:372) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'graphql' of undefined
Node-RED[372]: at /home/pi/.node-red/node_modules/node-red-contrib-graphql/graphql.js:192:36
Node-RED[372]: at runMicrotasks ()
Node-RED[372]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
Modifying line 192 in graph.js as below, and details of the problem are visible in the debugging output.
BEFORE: node.msg.payload.graphql = { error };
AFTER: node.msg = { payload: error };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions