mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-24 22:58:01 +03:00
agg ws improvements
This commit is contained in:
6
src/utils/assertError.ts
Normal file
6
src/utils/assertError.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
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)}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user