@synonymdev/pubky
    Preparing search index...

    Interface PubkyError

    Represents the standard error structure for all exceptions thrown by the Pubky WASM client.

    try {
    await client.signup(...);
    } catch (e) {
    const error = e as PubkyError;
    if (error.name === "RequestError") {
    const data = error.data as RequestErrorData;
    if (data.statusCode === 404) {
    // Handle not found...
    }
    }
    }
    interface PubkyError {
        data?: unknown;
        message: string;
        name: PubkyErrorName;
    }

    Hierarchy

    • Error
      • PubkyError
    Index
    data?: unknown

    Optional structured context. For a RequestError it is a RequestErrorData, e.g. { reason: "Http", statusCode: 404 }.

    message: string

    A human-readable, descriptive error message suitable for logging.

    A machine-readable error code from PubkyErrorName. Use this for programmatic error handling.