mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-16 07:02:36 +03:00
7 lines
260 B
TypeScript
7 lines
260 B
TypeScript
|
|
export default function assertError(errorCandidate: unknown): asserts errorCandidate is Error {
|
|
if (!(errorCandidate instanceof Error)) {
|
|
throw Error(`Assertion failed: errorCandidate is not an Error. Content: ${JSON.stringify(errorCandidate)}`);
|
|
}
|
|
}
|