godaddy / godaddy/node-openstack-wrapper

Keystone.js throws unhandled exception when auth fails

Đang mở
#31 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
34
Fork
33
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

If I use bad credentials (bad password or domain for example) I get an unhandled exception from keystone.js when calling keystone.getToken():

Uncaught TypeError: Cannot set property 'token' of undefined
at Request._callback (node_modules/openstack-wrapper/lib/keystone.js:138:22)
at Request.self.callback (node_modules/request/request.js:185:22)
at Request. (node_modules/request/request.js:1161:10)
at IncomingMessage. (node_modules/request/request.js:1083:12)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)

The problem seems to be that the code is expecting body.token to always exist, but in this case I can see the body is: {"error":{"message":"The request you have made requires authentication.","code":401,"title":"Unauthorized"}}

I'm using node.js v 8.11 (but same thing found in v 8.14 as well).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.