Skip to content

Commit

Permalink
thjs-63: * small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
v0ldemar01 committed Dec 16, 2023
1 parent bb106aa commit 28f8614
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parserOptions:
project:
- ./tsconfig.json
- ./shared/tsconfig.json
- ./client/jsconfig.json
- ./client/tsconfig.json
- ./server/tsconfig.json

settings:
Expand Down
10 changes: 8 additions & 2 deletions shared/src/libs/exceptions/http-error/http-error.exception.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { type ValueOf } from '~/libs/types/types.js';
import { ExceptionName } from '../../enums/enums.js';
import { HttpCode } from '../../packages/http/http.js';

const DEFAULT_MESSAGE = 'Network Error';

type Constructor = {
status: ValueOf<typeof HttpCode>;
message: string;
};

class HttpError extends Error {
status;
status: ValueOf<typeof HttpCode>;

constructor({
status = HttpCode.INTERNAL_SERVER_ERROR,
message = DEFAULT_MESSAGE
} = {}) {
}: Partial<Constructor> = {}) {
super(message);
this.status = status;
this.name = ExceptionName.HTTP_ERROR;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { User } from './user.type.js';
import { UserWithImageRelation } from './user-with-image-relation.type.js';

type UserAuthResponse = User;
type UserAuthResponse = UserWithImageRelation;

export { type UserAuthResponse };
5 changes: 1 addition & 4 deletions shared/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
"declarationMap": true,
"sourceMap": true,
"lib": ["ESNext"],
"noUnusedParameters": true,
"esModuleInterop": true,
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "dist",
"paths": {
"~/*": ["src/*"]
},
"types": ["node"],
"isolatedModules": true,
"strictNullChecks": true
"types": ["node"]
}
}
10 changes: 9 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true
"noPropertyAccessFromIndexSignature": true,
"skipLibCheck": true,
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noUnusedParameters": true
}
}

0 comments on commit 28f8614

Please sign in to comment.