Skip to content

Commit 132efb6

Browse files
authored
Stop/alter more logging (#1767)
* Catch GH import routine * Add `#bypass` to statusCodePage Post #1731 , applies to #430 #37 and closes #1730 Auto-merge
1 parent 90f0b70 commit 132efb6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

controllers/user.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -1682,13 +1682,17 @@ exports.userGitHubImportScriptPage = function (aReq, aRes, aNext) {
16821682
},
16831683
], function (aErr) {
16841684
var script = null;
1685+
var code = null;
16851686

16861687
if (aErr) {
1687-
console.error([
1688-
aErr,
1689-
authedUser.name + ' ' + githubUserId + ' ' + githubRepoName + ' ' + githubBlobPath
1688+
code = (aErr instanceof statusError ? aErr.status.code : aErr.code);
1689+
if (code && !isNaN(code) && code >= 500) {
1690+
console.error([
1691+
aErr,
1692+
authedUser.name + ' ' + githubUserId + ' ' + githubRepoName + ' ' + githubBlobPath
16901693

1691-
].join('\n'));
1694+
].join('\n'));
1695+
}
16921696

16931697
if (!(aErr instanceof String)) {
16941698
statusCodePage(aReq, aRes, aNext, {
@@ -1707,7 +1711,7 @@ exports.userGitHubImportScriptPage = function (aReq, aRes, aNext) {
17071711
});
17081712
} else {
17091713
statusCodePage(aReq, aRes, aNext, {
1710-
statusCode: 500, // NOTE: Watchpoint
1714+
statusCode: 500,
17111715
statusMessage: aErr
17121716
});
17131717
}

views/pages/statusCodePage.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h1 class="status-code text-center">{{statusCode}}</h1>
4545
Session Length: <strong>{{length}}</strong>
4646
{{/isAdminSessionLengthView}}
4747
{{#isGHImport}}
48-
{{{statusMessage}}}<br /><a href="https://github.com/{{user}}/{{repo}}/tree/{{default_branch}}/{{path}}"><b>{{utf_pathname}}</b>{{utf_pathext}}</a>
48+
{{{statusMessage}}}<br /><a href="https://github.com/{{user}}/{{repo}}/tree/{{default_branch}}/{{path}}#bypass=true"><b>{{utf_pathname}}</b>{{utf_pathext}}</a>
4949
{{/isGHImport}}
5050
{{#isListView}}
5151
{{{statusMessage}}}<br />Please retry {{#retryAfter}}after approximately {{retryAfter}} seconds{{/retryAfter}}{{^retryAfter}}later{{/retryAfter}}.

0 commit comments

Comments
 (0)