Skip to content

isConsoleSdkError

isConsoleSdkError(e): e is ConsoleSdkError

Defined in: console-sdk/src/errors/guards.ts:23

Narrows any caught value to the SDK’s error hierarchy. Everything the SDK rejects or reports is a ConsoleSdkError; anything else escaping is a bug.

unknown

e is ConsoleSdkError

try { await connectAsync(id); } catch (e) {
if (isConsoleSdkError(e)) console.warn(e.code);
}