Skip to content

Commit 4d79853

Browse files
committed
create http exception plugin
1 parent 865518a commit 4d79853

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+246
-200
lines changed

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"arrowParens": "always",
10+
"endOfLine": "lf"
11+
}

bun.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"devDependencies": {
77
"@types/bun": "latest",
88
"elysia": "^1.3.8",
9+
"prettier": "^3.6.2",
910
},
1011
"peerDependencies": {
1112
"typescript": "^5",
@@ -49,6 +50,8 @@
4950

5051
"openapi-types": ["[email protected]", "", {}, "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw=="],
5152

53+
"prettier": ["[email protected]", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="],
54+
5255
"strtok3": ["[email protected]", "", { "dependencies": { "@tokenizer/token": "^0.3.0" } }, "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg=="],
5356

5457
"token-types": ["[email protected]", "", { "dependencies": { "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" } }, "sha512-MD9MjpVNhVyH4fyd5rKphjvt/1qj+PtQUz65aFqAZA6XniWAuSFRjLk3e2VALEFlh9OwBpXUN7rfeqSnT/Fmkw=="],

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"name": "elysia-http-exception",
33
"type": "module",
4+
"scripts": {
5+
"format": "prettier --write '**/*.ts' --ignore-path .gitignore"
6+
},
47
"devDependencies": {
58
"@types/bun": "latest",
6-
"elysia": "^1.3.8"
9+
"elysia": "^1.3.8",
10+
"prettier": "^3.6.2"
711
},
812
"peerDependencies": {
913
"typescript": "^5"
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { HttpException } from "./http-exception";
2-
import { HttpError } from "../types/http-error";
1+
import { HttpException } from './http-exception';
2+
import { HttpError } from '../types/http-error';
33

44
export class BadGatewayException extends HttpException {
5-
constructor(message?: string | object | Error) {
6-
super(HttpError.BAD_GATEWAY, message);
7-
}
5+
constructor(message?: string | object | Error) {
6+
super(HttpError.BAD_GATEWAY, message);
7+
}
88
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { HttpException } from "./http-exception";
2-
import { HttpError } from "../types/http-error";
1+
import { HttpException } from './http-exception';
2+
import { HttpError } from '../types/http-error';
33

44
export class BadRequestException extends HttpException {
5-
constructor(message?: string | object | Error) {
6-
super(HttpError.BAD_REQUEST, message);
7-
}
5+
constructor(message?: string | object | Error) {
6+
super(HttpError.BAD_REQUEST, message);
7+
}
88
}

src/exceptions/conflict-exception.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { HttpException } from "./http-exception";
2-
import { HttpError } from "../types/http-error";
1+
import { HttpException } from './http-exception';
2+
import { HttpError } from '../types/http-error';
33

44
export class ConflictException extends HttpException {
5-
constructor(message?: string | object | Error) {
6-
super(HttpError.CONFLICT, message);
7-
}
5+
constructor(message?: string | object | Error) {
6+
super(HttpError.CONFLICT, message);
7+
}
88
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { HttpException } from "./http-exception";
2-
import { HttpError } from "../types/http-error";
1+
import { HttpException } from './http-exception';
2+
import { HttpError } from '../types/http-error';
33

44
export class ExpectationFailedException extends HttpException {
5-
constructor(message?: string | object | Error) {
6-
super(HttpError.EXPECTATION_FAILED, message);
7-
}
5+
constructor(message?: string | object | Error) {
6+
super(HttpError.EXPECTATION_FAILED, message);
7+
}
88
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { HttpException } from "./http-exception";
2-
import { HttpError } from "../types/http-error";
1+
import { HttpException } from './http-exception';
2+
import { HttpError } from '../types/http-error';
33

44
export class FailedDependencyException extends HttpException {
5-
constructor(message?: string | object | Error) {
6-
super(HttpError.FAILED_DEPENDENCY, message);
7-
}
5+
constructor(message?: string | object | Error) {
6+
super(HttpError.FAILED_DEPENDENCY, message);
7+
}
88
}

src/exceptions/forbidden-exception.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { HttpException } from "./http-exception";
2-
import { HttpError } from "../types/http-error";
1+
import { HttpException } from './http-exception';
2+
import { HttpError } from '../types/http-error';
33

44
export class ForbiddenException extends HttpException {
5-
constructor(message?: string | object | Error) {
6-
super(HttpError.FORBIDDEN, message);
7-
}
5+
constructor(message?: string | object | Error) {
6+
super(HttpError.FORBIDDEN, message);
7+
}
88
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { HttpException } from "./http-exception";
2-
import { HttpError } from "../types/http-error";
1+
import { HttpException } from './http-exception';
2+
import { HttpError } from '../types/http-error';
33

44
export class GatewayTimeoutException extends HttpException {
5-
constructor(message?: string | object | Error) {
6-
super(HttpError.GATEWAY_TIMEOUT, message);
7-
}
5+
constructor(message?: string | object | Error) {
6+
super(HttpError.GATEWAY_TIMEOUT, message);
7+
}
88
}

0 commit comments

Comments
 (0)