Errors
CoreRuntime error classes let apps distinguish missing providers, rejected requests, routing failures, node failures, and unsupported capabilities.
Signature
function toCkbFiberError(error: unknown): CkbFiberErrorPERMISSION
Not applicable.
Parameters
NameTypeDescription
errorrequiredunknownAn error thrown locally or serialized across the extension message bridge.
Response
NameTypeDescription
errorrequiredCkbFiberErrorA runtime error with a stable code and restored prototype.
Example
import {
requestProvider,
MissingProviderError,
UserRejectedError
} from "@fiber-webln/client";
try {
const fiber = await requestProvider();
await fiber.sendPayment(invoice);
} catch (error) {
if (error instanceof MissingProviderError) showInstallHelp();
if (error instanceof UserRejectedError) return;
}Provider behavior
W
WASM node
Background error codes are serialized through extension messaging; the client wrapper restores matching runtime classes.
R
Remote fnn
Uses the same stable codes, allowing an app to handle both providers identically.