This repository was archived by the owner on Aug 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +21
-14
lines changed
Expand file tree Collapse file tree 5 files changed +21
-14
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 11{
22 "name" : " @wvm/http-error" ,
3- "version" : " 1.0.0 " ,
3+ "version" : " 1.0.1 " ,
44 "publish" : {
55 "exclude" : [" assets" ]
66 },
Original file line number Diff line number Diff line change @@ -4,7 +4,13 @@ import { ErrorCode } from "./codes.ts";
44 * HTTP Error Class With Status Pair
55 */
66export 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 /**
Original file line number Diff line number Diff line change 1- import type { ErrorCode } from "./codes.ts" ;
21export { ErrorCode } from "./codes.ts" ;
3- import { HttpError } from "./error.ts" ;
42export { 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" ;
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments