Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 096715c

Browse files
committed
v1.0.1 patch jsr stuff
1 parent 5fc3bf8 commit 096715c

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed
File renamed without changes.

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wvm/http-error",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"publish": {
55
"exclude": ["assets"]
66
},

src/error.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ import { ErrorCode } from "./codes.ts";
44
* HTTP Error Class With Status Pair
55
*/
66
export class HttpError extends Error {
7+
/**
8+
* HTTP 4xx/5xx Status Code
9+
*/
710
readonly status: number;
11+
/**
12+
* HTTP 4xx/5xx Code Phrase
13+
*/
814
readonly phrase: string;
915

1016
/**

src/index.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
import type { ErrorCode } from "./codes.ts";
21
export { ErrorCode } from "./codes.ts";
3-
import { HttpError } from "./error.ts";
42
export { HttpError } from "./error.ts";
5-
6-
/**
7-
* Get HTTP Error With Tagged Templates
8-
* @param error HTTP Error Code/Phrase
9-
* @returns Tag Function For HTTP Error
10-
*/
11-
export function raise(
12-
error: ErrorCode | keyof typeof ErrorCode,
13-
): (...template: Parameters<typeof String.raw>) => HttpError {
14-
return (...template) => new HttpError(error, String.raw(...template));
15-
}
3+
export { raise } from "./raise.ts";

src/raise.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { ErrorCode } from "./codes.ts";
2+
import { HttpError } from "./error.ts";
3+
4+
/**
5+
* Get HTTP Error With Tagged Templates
6+
* @param error HTTP Error Code/Phrase
7+
* @returns Tag Function For HTTP Error
8+
*/
9+
export function raise(
10+
error: ErrorCode | keyof typeof ErrorCode,
11+
): (...template: Parameters<typeof String.raw>) => HttpError {
12+
return (...template) => new HttpError(error, String.raw(...template));
13+
}

0 commit comments

Comments
 (0)