mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-12-02 17:13:33 +01:00
fix(logging): give raw GitHub failures an error code, log missing branches as warnings
Overnight, GitHub refusals reached the logs as bare HTTPError/UnknownError with no code: a ZIP whose archive request was refused became a cut connection and a 502 zip_not_available, a 401 while checking a file became an uncoded 401, and an Octokit 403 on /options answered internal_error. - codeUpstreamError maps got/Octokit replies to repo_not_accessible, github_rate_limit_exceeded, github_unavailable or upstream_error; handleError applies it, the streamer file route uses the file-level mapping, and programming errors pass through unchanged. - A ZIP that fails before any byte answers with the code, so the API relays it; 4xx archive refusals log at warn. - branch_not_found (owner deleted the branch) logs at warn. - Octokit's HttpError is an allowlisted error type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
351ed12b28
commit
3f8812c99e
10 files changed
+195
-11
No files matched your search
@@ -37,7 +37,7 @@ function scan(dir) {
|
||||
}
|
||||
}
|
||||
scan('src');
|
||||
const types=['Error','TypeError','RangeError','ReferenceError','SyntaxError','URIError','EvalError','AggregateError','AnonymousError','HTTPError','RequestError','MongoServerError','MongoNetworkError','MongoServerSelectionError','ValidationError','TimeoutError','AbortError','UnknownError'];
|
||||
const types=['Error','TypeError','RangeError','ReferenceError','SyntaxError','URIError','EvalError','AggregateError','AnonymousError','HTTPError','HttpError','RequestError','MongoServerError','MongoNetworkError','MongoServerSelectionError','ValidationError','TimeoutError','AbortError','UnknownError'];
|
||||
const vrl=fs.readFileSync('deploy/logging/sanitize.vrl','utf8');
|
||||
const routes=JSON.parse(vrl.match(/if includes\((\[.*?\]), record.route\)/)[1]);
|
||||
const codes=[...thrownCodes].sort();
|
||||
|
||||
Reference in new issue
Block a user