mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-19 14:17:20 +02:00
12 lines
523 B
TypeScript
12 lines
523 B
TypeScript
/** Persisted repository failures need the same client status as the original error. */
|
|
export function repositoryFailureStatus(code?: string): number {
|
|
switch (code) {
|
|
case "repo_not_found": case "branch_not_found": case "commit_not_found": return 404;
|
|
case "repo_not_accessible": case "repository_not_accessible": return 403;
|
|
case "token_expired": case "not_connected": return 401;
|
|
case "github_rate_limit_exceeded": return 429;
|
|
case "github_unavailable": return 502;
|
|
default: return 500;
|
|
}
|
|
}
|