Skip to content
Prose v0.3.2

Error Types

Prose exports three error classes, all extending Error.

Thrown by .validate() steps for input validation failures.

new ValidationError(message: string, issues?: ValidationIssue[])
ValidationError.single(field: string, message: string): ValidationError
ValidationError.multiple(issues: ValidationIssue[]): ValidationError
PropertyTypeDescription
messagestringError message
issuesValidationIssue[]Array of { field, message } objects
  • .toJSON() — Returns a serializable representation with message and issues
// Single field
throw ValidationError.single('email', 'Invalid email');
// Multiple fields
throw new ValidationError('Validation failed', [
{ field: 'email', message: 'Required' },
{ field: 'age', message: 'Must be at least 18' },
]);

Thrown when a step fails during execution. Wraps the original error.

new FlowExecutionError(flowName: string, stepName: string, originalError: Error)
PropertyTypeDescription
flowNamestringName of the flow
stepNamestringName of the step that failed
originalErrorErrorThe actual error thrown by the step

Thrown when a flow or step exceeds its configured timeout.

PropertyTypeDescription
flowNamestringName of the flow
stepNamestring | undefinedStep name (undefined for flow-level timeout)
timeoutMsnumberThe timeout value that was exceeded