mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 04:00:24 +08:00
Simplify API error checks
This commit is contained in:
@@ -283,10 +283,12 @@ export function wrapApiConfigurationError(e: unknown) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== undefined) {
|
||||
if (
|
||||
httpError.message.includes("API rate limit exceeded") ||
|
||||
httpError.message.includes("commit not found") ||
|
||||
httpError.message.includes("Resource not accessible by integration") ||
|
||||
/ref .* not found in this repository/.test(httpError.message)
|
||||
[
|
||||
/API rate limit exceeded/,
|
||||
/commit not found/,
|
||||
/Resource not accessible by integration/,
|
||||
/ref .* not found in this repository/,
|
||||
].some((pattern) => pattern.test(httpError.message))
|
||||
) {
|
||||
return new ConfigurationError(httpError.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user