Skip to content

Commit fa41f27

Browse files
nemesifierfinnp
authored andcommitted
Handled Unauthorized Error from Gitter API
The Gitter API is now returning this error which is not being caught and the app is not working as expected anymore.
1 parent cdfcca3 commit fa41f27

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ module.exports = function (opts) {
4242
log('Connected to IRC, joined ' + opts.ircChannel)
4343
request.post({ url: 'https://api.gitter.im/v1/rooms', headers: headers, json: {uri: opts.gitterRoom} }, function (err, req, json) {
4444
if (err) return log(err)
45+
if (json.error) {
46+
return log('Error while communicating with the gitter API: ' + json.error);
47+
}
48+
4549
var gitterRoomId = json.id
4650
var postGitterMessageUrl = 'https://api.gitter.im/v1/rooms/' + gitterRoomId + '/chatMessages'
4751

0 commit comments

Comments
 (0)