@amqp-contract/contract@2.2.0
Minor Changes
-
bfc138c: Upgrade
unthrown(and@unthrown/vitest) to3.0.0.amqp-contract's own public surface is unchanged — the
Result/AsyncResultyou receive from the client and worker keep the same shape and methods, and no source changes were needed.unthrown 3.0 does change how a defect is produced inside a
qualifymapper, which matters only if you author handlers that intentionally route an unexpected failure to theDefectchannel:- The standalone
Defectconstructor is no longer exported. qualifynow receives a second argument — adefectcallback — so its signature is(cause, defect) => E | defect(cause).
- import { fromPromise, Defect } from "unthrown"; - fromPromise(work(), (cause) => isExpected(cause) ? new MyError(cause) : Defect(cause)); + import { fromPromise } from "unthrown"; + fromPromise(work(), (cause, defect) => isExpected(cause) ? new MyError(cause) : defect(cause));
Mappers that only return a modeled error (the common case — e.g.
(cause) => new RetryableError("…", cause)) are unaffected. - The standalone