A single translation rule, matched by from and the optional when guard.
from
when
Readonly
Maps the caught error to the error to re-throw. Pass the original as cause to preserve its stack and message chain: to: (error) => new DomainError("...", { cause: error }).
cause
to: (error) => new DomainError("...", { cause: error })
Optional
A single translation rule, matched by
fromand the optionalwhenguard.