Skip to content

Commit

Permalink
Handle 404 error for private repo
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed Nov 28, 2023
1 parent 24f02a2 commit 9cf74bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/services/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ export const signInAutomatically = async () => {
await get(backend).fetchFiles();
} catch (ex) {
// The API request may fail if the cached token has been expired or revoked. Then let the user
// sign in again
if ([401, 403].includes(ex.cause?.status)) {
// sign in again. 404 Not Found is also considered an authentication error.
// https://docs.github.com/en/rest/overview/troubleshooting-the-rest-api#404-not-found-for-an-existing-resource
if ([401, 403, 404].includes(ex.cause?.status)) {
unauthenticated.set(true);
} else {
logError(ex);
Expand Down

0 comments on commit 9cf74bf

Please sign in to comment.