Changelog - 2026-10-15
isApplicationError checks the whole shape
Bug Fix Behavior ChangeIn one line. A plain Error with a statusCode is no longer an ApplicationError.
typescript
const httpError = Object.assign(new Error('Request failed'), { statusCode: 502 });
isApplicationError(httpError); // false - it was true
isApplicationError(getError({ message: 'x', statusCode: 400 })); // true, as beforeWhat changed
isApplicationError() checked only instanceof Error and a numeric statusCode, yet narrowed the type to ApplicationError. Code after the guard then read normalized or called toFilledText() on an error that had neither, and crashed.
The guard now also requires normalized to be an object with a string text. It still tests shape, not class identity, so an ApplicationError from the other build copy (CJS against ESM) still matches.
Inside IGNIS this also fixes three paths that trusted the guard:
- A worker encoded such an error as an
ApplicationErrorenvelope with nonormalized. - The search connectors and the mail service rethrew it unwrapped, instead of sanitizing it as a 503 or 500.
Who is affected
- Code that relied on a
statusCode-only error passing the guard. Build the error withgetError, or checkstatusCodeyourself. - An
ApplicationErrorfrom a copy older than 0.2.2-0. It still matches, but has notoFilledText(). - Everyone else. No change.