@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" &&
    typeof error.data === "object" &&
    error.data !== null &&
    "statusCode" in error.data &&
    (error.data as { statusCode?: number }).statusCode === 404
    ) {
    // Handle not found...
    }
    }
    interface PubkyError {
        data?: unknown;
        message: string;
        name: PubkyErrorName;
    }

    Hierarchy

    • Error
      • PubkyError
    Index
    data?: unknown

    An optional payload containing structured context for an error. For a RequestError, this may contain an object with the HTTP status code, e.g., { 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.