Error Types
Prose exports three error classes, all extending Error.
ValidationError
Section titled “ValidationError”Thrown by .validate() steps for input validation failures.
Constructor
Section titled “Constructor”new ValidationError(message: string, issues?: ValidationIssue[])Static helpers
Section titled “Static helpers”ValidationError.single(field: string, message: string): ValidationErrorValidationError.multiple(issues: ValidationIssue[]): ValidationErrorProperties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
message | string | Error message |
issues | ValidationIssue[] | Array of { field, message } objects |
Methods
Section titled “Methods”.toJSON()— Returns a serializable representation with message and issues
Example
Section titled “Example”// Single fieldthrow ValidationError.single('email', 'Invalid email');
// Multiple fieldsthrow new ValidationError('Validation failed', [ { field: 'email', message: 'Required' }, { field: 'age', message: 'Must be at least 18' },]);FlowExecutionError
Section titled “FlowExecutionError”Thrown when a step fails during execution. Wraps the original error.
Constructor
Section titled “Constructor”new FlowExecutionError(flowName: string, stepName: string, originalError: Error)Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
flowName | string | Name of the flow |
stepName | string | Name of the step that failed |
originalError | Error | The actual error thrown by the step |
TimeoutError
Section titled “TimeoutError”Thrown when a flow or step exceeds its configured timeout.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
flowName | string | Name of the flow |
stepName | string | undefined | Step name (undefined for flow-level timeout) |
timeoutMs | number | The timeout value that was exceeded |