@reclaimprotocol/attestor-core
Version:
<div> <div> <img src="https://raw.githubusercontent.com/reclaimprotocol/.github/main/assets/banners/Attestor-Core.png" /> </div> </div>
28 lines (27 loc) • 834 B
TypeScript
import { ErrorCode, ErrorData } from '../proto/api';
/**
* Represents an error that can be thrown by the Attestor Core
* or server. Provides a code, and optional data
* to pass along with the error.
*/
export declare class AttestorError extends Error {
code: keyof typeof ErrorCode;
message: string;
data?: {
[_: string]: any;
} | undefined;
readonly name = "AttestorError";
constructor(code: keyof typeof ErrorCode, message: string, data?: {
[_: string]: any;
} | undefined);
/**
* Encodes the error as a ErrorData
* protobuf message
*/
toProto(): ErrorData;
static fromProto(data?: ErrorData): AttestorError;
static fromError(err: Error): AttestorError;
static badRequest(message: string, data?: {
[_: string]: any;
}): AttestorError;
}