import type { ConfigurationSchema } from './config/schema.js';
import type { AnyServiceLocals, ServiceLike, ServiceLocals } from './types.js';
export interface ServiceErrorSpec {
    status?: number;
    code?: string;
    domain?: string;
    display_message?: string;
    log_stack?: boolean;
    expected_error?: boolean;
    client_metadata?: Record<string, unknown>;
}
/**
 * An error that gives more structured information to callers. Throw inside a handler as
 *
 *   throw new Error(req, 'Something broke', { code: 'SomethingBroke', status: 400 });
 *
 * You can also include a display_message which is intended to be viewed by the end user
 */
export declare class ServiceError<SLocals extends AnyServiceLocals = ServiceLocals<ConfigurationSchema>> extends Error {
    status: number | undefined;
    code?: string;
    domain: string;
    display_message?: string;
    log_stack?: boolean;
    client_metadata?: Record<string, unknown>;
    expected_error?: boolean;
    constructor(app: ServiceLike<SLocals>, message: string, spec?: ServiceErrorSpec);
}
