Are we missing an is undefined check?
Closed this issue · 4 comments
kvz commented
Just got:
/Users/kvz/code/content/node_modules/transloadit/lib/TransloaditClient.js:588
var body = _ref5.body,
^
TypeError: Cannot read property 'body' of undefined
at Request._callback (/Users/kvz/code/content/node_modules/transloadit/lib/TransloaditClient.js:588:25)
at self.callback (/Users/kvz/code/content/node_modules/transloadit/node_modules/request/request.js:187:22)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at Timeout._onTimeout (/Users/kvz/code/content/node_modules/transloadit/node_modules/request/request.js:762:12)
at ontimeout (timers.js:488:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:283:5)
So that seems another issue, we don't ship working sourcemaps right now.
Patched around it via:
if (err) {
return cb(err);
}
if (!_ref5) {
return cb(new Error('No data for request!'));
}
var body = _ref5.body,
statusCode = _ref5.statusCode;
for now.
tim-kos commented
Alright, cheers. Will look into it.
kvz commented
After some thinking, I think we should not do es6 object deconstruction since this assumes the existence of object properties before checking for errors. Switching back to just an object and then checking for errors, and then checking for object properties likely resolves this already
Sent from mobile, pardon the brevity.
… On 14 Sep 2017, at 07:51, Tim Koschuetzki ***@***.***> wrote:
Alright, cheers. Will look into it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
tim-kos commented
💪 👍