Skip to main content

Error Handling

All errors return an ErrorResponse with a typed error.type field. Always branch on error.type — never on error.message, which may change between versions.


Error Response Shape

interface ErrorResponse {
error: {
type: ErrorType; // machine-readable, stable
message: string; // human-readable
location?: string; // where the error occurred
suggestion?: string; // actionable fix hint
};
}

Error Types

TypeCategoryDescription
type_errorType systemInvalid input type or incompatible type-strategy pairing.
semantic_errorCompilerDefinition fails semantic validation.
reference_errorCompilerUnknown primitive, feature, or concept reference.
parameter_errorValidationInvalid parameter value.
graph_errorCompilerCircular dependency in DAG.
execution_errorRuntimeConcept compiled but runtime failed.
execution_timeoutRuntimeExceeded 30-second synchronous timeout.
auth_errorAuthMissing or invalid API key.
not_foundRegistryResource not found at given id and version.
conflictRegistryDefinition already exists at this id + version.
rate_limit_exceededRate limitingToo many requests. Respect Retry-After.
bounds_exceededCalibrationRecommendation would exceed guardrails threshold_bounds.
action_binding_failedTask creationNo valid action resolved during task creation.

TypeScript Error Handling

try {
const task = await client.tasks.create({ intent: "...", ... });
} catch (err) {
if (err instanceof MemintelError) {
switch (err.type) {
case "not_found":
console.error("Check id/version:", err.message);
break;
case "execution_error":
console.error("Data issue at", err.location);
break;
case "rate_limit_exceeded":
await sleep(err.retryAfterSeconds * 1000);
break;
case "action_binding_failed":
console.error(err.suggestion);
break;
case "bounds_exceeded":
console.error("Hit guardrail bound:", err.message);
break;
default:
throw err;
}
}
}