Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed error handling.
  • Loading branch information
j-rewerts committed Oct 22, 2019
commit cd8c27fe088c108db7b00ce70de1295b9789f22e
2 changes: 1 addition & 1 deletion lib/Requestable.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function getNextPage(linksHeader = '') {
function callbackErrorOrThrow(cb, path) {
return function handler(object) {
let error;
if (object.hasOwnProperty('config')) {
if (object.hasOwnProperty('config') && object.response) {
const {response: {status, statusText}, config: {method, url}} = object;
let message = (`${status} error making request ${method} ${url}: "${statusText}"`);
error = new ResponseError(message, path, object);
Expand Down