kequapp
Version:
DEPRECATED: renamed to @kequtech/arbor
53 lines (52 loc) • 1.96 kB
TypeScript
import type { ServerEx } from './types.ts';
type ExceptionOptions = {
cause?: unknown;
} & Record<string, unknown>;
type ServerExHelper = (message?: string, options?: ExceptionOptions) => ServerEx;
interface Ex {
StatusCode: (statusCode: number, message?: string, options?: ExceptionOptions) => ServerEx;
BadRequest: ServerExHelper;
Unauthorized: ServerExHelper;
PaymentRequired: ServerExHelper;
Forbidden: ServerExHelper;
NotFound: ServerExHelper;
MethodNotAllowed: ServerExHelper;
NotAcceptable: ServerExHelper;
ProxyAuthenticationRequired: ServerExHelper;
RequestTimeout: ServerExHelper;
Conflict: ServerExHelper;
Gone: ServerExHelper;
LengthRequired: ServerExHelper;
PreconditionFailed: ServerExHelper;
PayloadTooLarge: ServerExHelper;
URITooLong: ServerExHelper;
UnsupportedMediaType: ServerExHelper;
RangeNotSatisfiable: ServerExHelper;
ExpectationFailed: ServerExHelper;
ImATeapot: ServerExHelper;
MisdirectedRequest: ServerExHelper;
UnprocessableEntity: ServerExHelper;
Locked: ServerExHelper;
FailedDependency: ServerExHelper;
TooEarly: ServerExHelper;
UpgradeRequired: ServerExHelper;
PreconditionRequired: ServerExHelper;
TooManyRequests: ServerExHelper;
RequestHeaderFieldsTooLarge: ServerExHelper;
UnavailableForLegalReasons: ServerExHelper;
InternalServerError: ServerExHelper;
NotImplemented: ServerExHelper;
BadGateway: ServerExHelper;
ServiceUnavailable: ServerExHelper;
GatewayTimeout: ServerExHelper;
HTTPVersionNotSupported: ServerExHelper;
VariantAlsoNegotiates: ServerExHelper;
InsufficientStorage: ServerExHelper;
LoopDetected: ServerExHelper;
BandwidthLimitExceeded: ServerExHelper;
NotExtended: ServerExHelper;
NetworkAuthenticationRequired: ServerExHelper;
}
export declare const Ex: Ex;
export declare function unknownToEx(error: unknown): ServerEx;
export {};