Whenever I try to throw RefreshAuthError, it shows it is unhandled instead of calling the refreshAccessToken.
This is the error stack
Unhandled error: RefreshAuthError:
What happened:
Starting POST request to {url}
Received 400 code from {url} after 1956ms
Received content "
{
"response":{
"action":"action",
"error":{
"code":8535,
"message":"Invalid Oauthtoken"
RefreshAuthError
at afterResponse (/zapier/sample/index.js:16:15)
at Object.collector.then (/zapier/sample/node_modules/zapier-platform-core/src/middleware.js:80:37)
at bound (domain.js:395:14)
at Object.runBound (domain.js:408:12)
at Object.tryCatcher (Documents/zapier/sample/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/zapier/sample/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/zapier/sample/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/zapier/sample/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/zapier/sample/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/zapier/sample/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/zapier/sample/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/zapier/sample/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues las _onImmediate] (/zapier/sample/node_modules/bluebird/js/release/async.js:15:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
at process.topLevelDomainCallback (domain.js:120:23)
1) should create an object