MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / isApiKeyError

Function isApiKeyError

out/cli.cjs:74425–74442  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

74423 const response = error.response;
74424 if (response?.status === 404) {
74425 return true;
74426 }
74427 }
74428 }
74429 return false;
74430}
74431function isApiKeyError(error) {
74432 if (error instanceof ApiKeyMissingError) {
74433 return true;
74434 }
74435 if (error instanceof Error) {
74436 const message = error.message.toLowerCase();
74437 if (message.includes("api key") || message.includes("apikey") || message.includes("authentication") || message.includes("unauthorized") || message.includes("invalid_api_key") || message.includes("incorrect api key")) {
74438 return true;
74439 }
74440 if ("response" in error) {
74441 const response = error.response;
74442 if (response?.status === 401) {
74443 return true;
74444 }
74445 }

Callers 1

formatUserFriendlyErrorFunction · 0.70

Calls 2

toLowerCaseMethod · 0.80
includesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…