Skip to content

Commit 7616b42

Browse files
vdberghppigazzini
authored andcommitted
Add clarifying note when diff yields status 401 (Unauthorized)
1 parent 4b4edd4 commit 7616b42

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

server/fishtest/templates/tests_view.mak

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,16 @@
896896
} catch(e) {
897897
console.error(e);
898898
}
899-
if(remainingApiCalls(response) === 0) {
900-
text += "<br>Note: Apparently the <a href='/rate_limits'>GitHub API rate limit</a> was exceeded. \
901-
Try to add a <a href='https://github.com/settings/personal-access-tokens' \
902-
target='_blank'>GitHub personal access token</a> to your <a href='/user'>profile</a> \
903-
or else use 'View on GitHub'."
899+
if(status == 401) {
900+
text += `<br>Note: Apparently you are not allowed to use the GitHub API.
901+
This may be caused by an expired, revoked or otherwise invalid
902+
<a href='https://github.com/settings/personal-access-tokens'
903+
target='_blank'>GitHub personal access token</a> in your <a href='/user'>profile</a>.`
904+
} else if(remainingApiCalls(response) === 0) {
905+
text += `<br>Note: Apparently the <a href='/rate_limits'>GitHub API rate limit</a> was exceeded.
906+
Try to add a <a href='https://github.com/settings/personal-access-tokens'
907+
target='_blank'>GitHub personal access token</a> to your <a href='/user'>profile</a>
908+
or else use 'View on GitHub'.`
904909
}
905910
}
906911
showDiffError(diffError, text);

0 commit comments

Comments
 (0)