MCPcopy Create free account
hub / github.com/clientdb/clientdb / getErrorFromMessageOrError

Function getErrorFromMessageOrError

core/utils/assert.ts:11–17  ·  view source on GitHub ↗
(messageOrError: MessageOrError)

Source from the content-addressed store, hash-verified

9export type MessageOrError = string | Error;
10
11function getErrorFromMessageOrError(messageOrError: MessageOrError): Error {
12 if (typeof messageOrError === "string") {
13 return new AssertError(messageOrError);
14 }
15
16 return messageOrError;
17}
18
19
20export function assert(

Callers 1

assertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected