moul / node-gitlab

DEPRECATED, see https://github.com/node-gitlab/node-gitlab
https://npmjs.org/package/gitlab
Other
470 stars 140 forks source link

Ucaught error on server unavailability. #181

Closed lukjar closed 5 years ago

lukjar commented 7 years ago

When GitLab server is down API call causes:

/usr/src/app/node_modules/gitlab/lib/ApiBaseHTTP.js:88
             return fn(err, ret || JSON.parse(response.body).message);
TypeError: Cannot read property 'body' of null

what results in error which is difficult to catch in application code. Probably the good idea is to check that response is not empty (in fact only err object exists).

omerlh commented 7 years ago

Might be related to #136? Anyway, I am experiencing the same issue