From 132efb6fbfa6d2b5f4eba60ac6d2d11a18c8d40f Mon Sep 17 00:00:00 2001 From: Marti Martz Date: Thu, 24 Sep 2020 20:37:16 -0600 Subject: [PATCH] Stop/alter more logging (#1767) * Catch GH import routine * Add `#bypass` to statusCodePage Post #1731 , applies to #430 #37 and closes #1730 Auto-merge --- controllers/user.js | 14 +++++++++----- views/pages/statusCodePage.html | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/controllers/user.js b/controllers/user.js index b87d05b9b..161f9dae8 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -1682,13 +1682,17 @@ exports.userGitHubImportScriptPage = function (aReq, aRes, aNext) { }, ], function (aErr) { var script = null; + var code = null; if (aErr) { - console.error([ - aErr, - authedUser.name + ' ' + githubUserId + ' ' + githubRepoName + ' ' + githubBlobPath + code = (aErr instanceof statusError ? aErr.status.code : aErr.code); + if (code && !isNaN(code) && code >= 500) { + console.error([ + aErr, + authedUser.name + ' ' + githubUserId + ' ' + githubRepoName + ' ' + githubBlobPath - ].join('\n')); + ].join('\n')); + } if (!(aErr instanceof String)) { statusCodePage(aReq, aRes, aNext, { @@ -1707,7 +1711,7 @@ exports.userGitHubImportScriptPage = function (aReq, aRes, aNext) { }); } else { statusCodePage(aReq, aRes, aNext, { - statusCode: 500, // NOTE: Watchpoint + statusCode: 500, statusMessage: aErr }); } diff --git a/views/pages/statusCodePage.html b/views/pages/statusCodePage.html index 093b3cada..826de0c17 100644 --- a/views/pages/statusCodePage.html +++ b/views/pages/statusCodePage.html @@ -45,7 +45,7 @@

{{statusCode}}

Session Length: {{length}} {{/isAdminSessionLengthView}} {{#isGHImport}} - {{{statusMessage}}}
{{utf_pathname}}{{utf_pathext}} + {{{statusMessage}}}
{{utf_pathname}}{{utf_pathext}} {{/isGHImport}} {{#isListView}} {{{statusMessage}}}
Please retry {{#retryAfter}}after approximately {{retryAfter}} seconds{{/retryAfter}}{{^retryAfter}}later{{/retryAfter}}.