You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the ResponseError object is created, it accesses response.content causing that error to be thrown:
Error: You passed {raw: true} in request() - the response.content property is not available! Try response.body.pipe() for streaming, response.buffer() for a buffer, or response.text() for string.
at Response.get (:censored:9:d1ba0cf2aa:/node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js:20:13)
at new ResponseError (:censored:9:d1ba0cf2aa:/node_modules/zapier-platform-core/src/errors.js:28:27)
at throwForStatus (:censored:9:d1ba0cf2aa:/node_modules/zapier-platform-core/src/http-middlewares/after/throw-for-status.js:11:11)
at Object.<anonymous> (:censored:9:d1ba0cf2aa:/node_modules/zapier-platform-core/src/middleware.js:80:37)
at bound (domain.js:427:14)
at Object.runBound (domain.js:440:12)
at Object.tryCatcher (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (:censored:9:d1ba0cf2aa:/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:461:21)
at process.topLevelDomainCallback (domain.js:138:15)
at process.callbackTrampoline (internal/async_hooks.js:124:14)
This means that if the error is a 401, the refresh authentication does not happen. It also makes it difficult to even know what the error was from the request.
Bug Description
If the request is set to
raw
, theprepareRawResponse
function sets thecontent
property of the response to throw anError
: https://github.com/zapier/zapier-platform/blob/master/packages/core/src/http-middlewares/after/prepare-response.js#L18When the
ResponseError
object is created, it accessesresponse.content
causing that error to be thrown:This means that if the error is a
401
, the refresh authentication does not happen. It also makes it difficult to even know what the error was from the request.Reproduction Steps
raw
request:401
response should cause the error to occur.Version Info
zapier-platform-core
dependency: 10.1.2The text was updated successfully, but these errors were encountered: