FFiber WebLN
API / Reference / Errors

Errors

Core

Runtime error classes let apps distinguish missing providers, rejected requests, routing failures, node failures, and unsupported capabilities.

Signature

function toCkbFiberError(error: unknown): CkbFiberError
PERMISSION

Not applicable.

Parameters

NameTypeDescription
errorrequiredunknown

An error thrown locally or serialized across the extension message bridge.

Response

NameTypeDescription
errorrequiredCkbFiberError

A 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.

Errors