/** * What an API call throws when the server did not answer with a success. * * One error class for every JSON route rather than a result type per method: the status is * what a caller branches on, and it is carried here alongside whatever the server said, so * "the job was already finished" (409) and "no job of yours has that id" (404) are told apart * without parsing a message. `body` is the parsed response when there was one, so a 409 on a * cancel still hands back the job, and a 409 on an answer still hands back the delivery. */ export declare class ButlerBotAPIError extends Error { /** The HTTP status the server answered with, or 0 when the call never got a response. */ readonly status: number; readonly statusText: string; /** The server's short `error`, e.g. "Already finished". */ readonly error?: string; /** The server's `errormessage`: the same thing in a sentence. */ readonly errormessage?: string; /** The parsed response body, or the raw text when it was not JSON. */ readonly body: unknown; constructor(options: { action: string; status: number; statusText?: string; error?: string; errormessage?: string; body?: unknown; }); /** The resource is not there, or is not this key's. The two are answered alike on purpose. */ get isNotFound(): boolean; /** Somebody got there first: the job had finished, or the delivery was already answered. */ get isConflict(): boolean; /** The request itself was refused: a value the server would not take. */ get isBadRequest(): boolean; }