opsgenie / opsgenie-nodejs-sdk

OpsGenie Node.js SDK
https://www.opsgenie.com/docs/api-and-client-libraries/opsgenie-nodejs-api
Apache License 2.0
25 stars 19 forks source link

Cannot set property 'response_stringified' of null #9

Closed YevheniiHerasymchuk closed 3 years ago

YevheniiHerasymchuk commented 7 years ago
            err.response_stringified = JSON.stringify(response);
                                     ^
TypeError: Cannot set property 'response_stringified' of null
    at handleResponse (/mnt/Code/node_modules/opsgenie-sdk/lib/restApi.js:124:38)
    at Request.<anonymous> (/mnt/Code/node_modules/opsgenie-sdk/lib/restApi.js:110:9)
    at Request._callback (/mnt/Code/node_modules/opsgenie-sdk/node_modules/requestretry/node_modules/lodash/lodash.js:10067:25)
    at Request.requestRetryReply [as reply] (/mnt/Code/node_modules/opsgenie-sdk/node_modules/requestretry/index.js:105:19)
    at Request.<anonymous> (/mnt/Code/node_modules/opsgenie-sdk/node_modules/requestretry/index.js:133:10)
    at Request.self.callback (/mnt/Code/node_modules/request/request.js:188:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/mnt/Code/node_modules/request/request.js:1171:10)
    at Request.emit (events.js:107:17)
    at IncomingMessage.<anonymous> (/mnt/Code/node_modules/request/request.js:1091:12)
    at IncomingMessage.g (events.js:199:16)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

The error is in this part:


    if (response.statusCode < 200 || response.statusCode >= 300) {
        if (process.env.NODE_ENV === 'development') {
            err.response_stringified = JSON.stringify(response);
        }```
igor-slotin commented 7 years ago

PR with fix https://github.com/opsgenie/opsgenie-nodejs-sdk/pull/10

archa347 commented 6 years ago

Just ran into this same issue. Any update on getting that fix merged?

speterson-riskalyze commented 6 years ago

Ran into this this morning as well. Can we get this fix merged ASAP?

gabdsg commented 4 years ago

Same error here