Exceptions: TypeScript
Exception classes raised by @guardrails/guardrails-ts
.
export class GuardrailError extends Error {}
export class GuardrailTripwireTriggered extends GuardrailError {
public readonly guardrailResult: GuardrailResult;
}
export class GuardrailConfigurationError extends GuardrailError {}
export class GuardrailNotFoundError extends GuardrailError {}
export class GuardrailExecutionError extends GuardrailError {
public readonly cause?: Error;
}
GuardrailTripwireTriggered
: thrown when a guardrail tripwire fires. Contains theguardrailResult
.GuardrailConfigurationError
: configuration issues (invalid spec, missing params).GuardrailNotFoundError
: referenced guardrail name not registered.GuardrailExecutionError
: runtime failure within a guardrail (optionalcause
).
For the full source, see guardrails-ts/src/exceptions.ts in the repository.