Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6165f1e

Browse files
committedJun 11, 2019
Check err.stack before log stack information
1 parent 5c86bfa commit 6165f1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎scripts/stackstorm.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ module.exports = function(robot) {
133133
}
134134

135135
function logErrorAndExit(err, res) {
136-
if (err) {
136+
if (err && err.stack) {
137137
robot.logger.error(err.stack);
138138
}
139139
if (res) {
@@ -251,7 +251,7 @@ module.exports = function(robot) {
251251
.catch(function (err) {
252252
var error_msg = 'Failed to retrieve commands from "%s": %s';
253253
robot.logger.error(util.format(error_msg, env.ST2_API_URL, err.message));
254-
if (err.status === 401 && err.message.includes("Unauthorized")) {
254+
if (err.status === 401 || err.message.includes("Unauthorized")) {
255255
logErrorAndExit(err);
256256
}
257257
});

0 commit comments

Comments
 (0)
Please sign in to comment.