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

Function isInsufficientCreditsMessage

src/utils/engineErrorHandler.ts:104–115  ·  view source on GitHub ↗

* Checks if the error message indicates insufficient credits

(message: string)

Source from the content-addressed store, hash-verified

102 * Checks if the error message indicates insufficient credits
103 */
104function isInsufficientCreditsMessage(message: string): boolean {
105 const lowerMessage = message.toLowerCase();
106 return (
107 lowerMessage.includes('insufficient') ||
108 lowerMessage.includes('credit') ||
109 lowerMessage.includes('quota') ||
110 lowerMessage.includes('balance too low') ||
111 lowerMessage.includes('billing') ||
112 lowerMessage.includes('payment required') ||
113 lowerMessage.includes('exceeded')
114 );
115}
116
117/**
118 * Normalizes raw API errors into typed error classes.

Callers 1

normalizeEngineErrorFunction · 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…