Files
vercel__workflow/.changeset/error-subclass-serialization.md
Nathan Rajlich e7ea0684f4 Add first-class serialization for built-in Error subclasses (#1511)
* Add first-class serialization for built-in Error subclasses

Replace the generic Error reducer/reviver with specific handlers for
TypeError, RangeError, SyntaxError, URIError, ReferenceError, EvalError,
and AggregateError. Preserve the cause property on all Error types,
only serializing it when present to maintain absence vs presence
semantics.

* Refactor Error subclass reducers/revivers with helper functions

Extract repetitive reducer/reviver logic into makeErrorSubclassReducer
and makeErrorSubclassReviver helpers. Reduces ~120 lines of duplicated
code to ~50 while preserving identical behavior. AggregateError remains
as a wrapping extension since it needs to preserve the errors array.

* Bump error-subclass-serialization changeset to minor

Adding new serialization support for built-in Error subclasses is a
feature, not a bug fix.
2026-05-01 18:39:01 +00:00

258 B

@workflow/core
@workflow/core
minor

Add first-class serialization support for built-in Error subclasses (TypeError, RangeError, SyntaxError, URIError, ReferenceError, EvalError, AggregateError) and preserve the cause property on all Error types