Function: isResourceExhaustedError()
isResourceExhaustedError(
errorMessage):boolean
Defined in: packages/core/src/utils/retry.ts:150
Detect if an error message indicates resource exhaustion
Resource exhaustion errors typically shouldn't be retried as the system needs time to recover. Use this to detect and handle gracefully.
Parameters
errorMessage
string
The error message to check
Returns
boolean
true if the error indicates resource exhaustion
Example
try {
await spawnProcess();
} catch (error) {
if (isResourceExhaustedError(error.message)) {
return { success: false, error: 'System resources exhausted, try again later' };
}
throw error;
}