assertError()
Home > @backstage/errors
> assertError
Asserts that an unknown value is an ErrorLike object, which guarantees that it's an object that has at least two string properties: a non-empty name
and message
.
If the value is not an ErrorLike object, an error is thrown.
Signature:
function assertError(value: unknown): asserts value is ErrorLike;
Parameters
Parameter |
Type |
Description |
---|---|---|
value |
unknown |
an unknown value |
asserts value is ErrorLike