onErrorlike
OnErrorlike is a term used in discussions of error handling and type design to describe values or handlers that relate to errors but are not necessarily actual instances of the Error class. The concept often appears in the context of duck typing and flexible type systems, where an object can be treated as error-like if it exposes enough properties to convey an error condition.
In type design, an error-like shape is sometimes referred to as ErrorLike. Commonly, such objects include at
A typical use pattern is to define a type or interface that captures the minimal required properties
In API design, the term onErrorlike can also inform naming conventions for callbacks or event handlers that