Skip to content

Commit bd980d9

Browse files
committed
fix(core): refine HttpError.status property type
1 parent cea7a2a commit bd980d9

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

deno.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/error.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { STATUS_TEXT } from "@std/http/status";
1+
import { type ErrorStatus, STATUS_TEXT } from "@std/http/status";
22

33
/**
44
* Error that's thrown when a request fails. Correlates to a
@@ -54,7 +54,7 @@ export class HttpError extends Error {
5454
* }
5555
* ```
5656
*/
57-
status: number;
57+
status: ErrorStatus;
5858

5959
/**
6060
* Constructs a new instance.
@@ -65,7 +65,7 @@ export class HttpError extends Error {
6565
* @param options Optional error options.
6666
*/
6767
constructor(
68-
status: keyof typeof STATUS_TEXT,
68+
status: ErrorStatus,
6969
message: string = STATUS_TEXT[status],
7070
options?: ErrorOptions,
7171
) {

0 commit comments

Comments
 (0)