MCPcopy
hub / github.com/di-sukharev/opencommit / isRateLimitError

Function isRateLimitError

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

Source from the content-addressed store, hash-verified

74470 const response = error.response;
74471 if (response?.status === 402) {
74472 return true;
74473 }
74474 }
74475 }
74476 return false;
74477}
74478function isRateLimitError(error) {
74479 if (error instanceof RateLimitError3) {
74480 return true;
74481 }
74482 if (error instanceof Error) {
74483 const message = error.message.toLowerCase();
74484 if (message.includes("rate limit") || message.includes("rate_limit") || message.includes("too many requests") || message.includes("throttle")) {
74485 return true;
74486 }
74487 if ("status" in error && error.status === 429) {
74488 return true;
74489 }
74490 if ("response" in error) {
74491 const response = error.response;
74492 if (response?.status === 429) {
74493 return true;
74494 }
74495 }

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…