Skip to content
Merged
8 changes: 5 additions & 3 deletions src/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { STATUS_TEXT } from "@std/http/status";
import { type ErrorStatus, STATUS_TEXT } from "@std/http/status";

export type { ErrorStatus };

/**
* Error that's thrown when a request fails. Correlates to a
Expand Down Expand Up @@ -54,7 +56,7 @@ export class HttpError extends Error {
* }
* ```
*/
status: number;
status: ErrorStatus;

/**
* Constructs a new instance.
Expand All @@ -65,7 +67,7 @@ export class HttpError extends Error {
* @param options Optional error options.
*/
constructor(
status: keyof typeof STATUS_TEXT,
status: ErrorStatus,
message: string = STATUS_TEXT[status],
options?: ErrorOptions,
) {
Expand Down
Loading