Skip to content

Commit aef37f1

Browse files
committed
chore: 폴더명 수정
1 parent 6ba7bd1 commit aef37f1

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

server/apis/auth/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import axios from "axios";
22
import env from "@config";
33
import userModel from "@apis/user/model";
44
import * as jwt from "@utils/jwt";
5-
import AuthorizationError from "@exceptions/authorization-error";
5+
import AuthorizationError from "@errors/authorization-error";
66

77
interface TokenResponse {
88
access_token: string;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import CustomError from ".";
2+
import { UNAUTHORIZED } from "@constants/http-status";
3+
4+
export default class AuthorizationError extends CustomError {
5+
constructor(message: string = "Unauthorized") {
6+
super(message, UNAUTHORIZED);
7+
}
8+
}

server/errors/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { INTERNAL_SERVER_ERROR } from "@constants/http-status";
2+
3+
export default class CustomError extends Error {
4+
message!: string;
5+
status!: number;
6+
7+
constructor(
8+
message: string = "Internal Server Error",
9+
status: number = INTERNAL_SERVER_ERROR
10+
) {
11+
super();
12+
13+
this.message = message;
14+
this.status = status;
15+
}
16+
}

server/tsconfig.path.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"@apis/*": ["apis/*"],
66
"@config": ["config"],
77
"@constants/*": ["constants/*"],
8-
"@exceptions/*": ["exceptions/*"],
8+
"@errors/*": ["errors/*"],
99
"@db": ["db"],
1010
"@middlewares/*": ["middlewares/*"],
1111
"@utils/*": ["utils/*"]

0 commit comments

Comments
 (0)