A catch binding is unknown — it may be an Error, a string, a plain object from a
rejected fetch, or anything a third party threw. This flattens all of it to one shape so a
handler can rely on .context and .toString().
⚠️ An existing Error is passed through and cast, not rebuilt: the result keeps the
original prototype, so a TypeError stays a TypeError and gains no context. Only
non-Error values are wrapped, with the original preserved under context.originalError.
Coerces any caught value into a GeoLeafError.
A
catchbinding isunknown— it may be anError, a string, a plain object from a rejected fetch, or anything a third party threw. This flattens all of it to one shape so a handler can rely on.contextand.toString().⚠️ An existing
Erroris passed through and cast, not rebuilt: the result keeps the original prototype, so aTypeErrorstays aTypeErrorand gains nocontext. Only non-Errorvalues are wrapped, with the original preserved undercontext.originalError.