Skip to content

Commit

Permalink
Merge pull request #47 from Xitija/main2
Browse files Browse the repository at this point in the history
PS - 1895 Fix extra event issues to create event as per required time zone AND PS-1958 Hasura adapted remove and sonar critical fixes from event service
  • Loading branch information
Shubham4026 authored Sep 26, 2024
2 parents a6355d4 + a693b9b commit 965a381
Show file tree
Hide file tree
Showing 13 changed files with 610 additions and 868 deletions.
557 changes: 199 additions & 358 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"axios": "^1.6.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"moment-timezone": "^0.5.45",
"pg": "^8.13.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1"
},
Expand Down
15 changes: 7 additions & 8 deletions src/common/filters/exception.filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ import { ERROR_MESSAGES } from '../utils/constants.util';
export class AllExceptionsFilter implements ExceptionFilter {
constructor(private readonly apiId?: string) {}

catch(exception: unknown, host: ArgumentsHost) {
console.log('exception', exception);
catch(
exception: Error | HttpException | QueryFailedError,
host: ArgumentsHost,
) {
const ctx = host.switchToHttp();
const response = ctx.getResponse<Response>();
const status =
exception instanceof HttpException ? exception.getStatus() : 500;
const exceptionResponse =
exception instanceof HttpException ? exception.getResponse() : null;
const errorMessage =
exception instanceof HttpException
? (exceptionResponse as any).message || exception.message
: ERROR_MESSAGES.INTERNAL_SERVER_ERROR;

let errorMessage =
exception?.message || ERROR_MESSAGES.INTERNAL_SERVER_ERROR;

if (exception instanceof QueryFailedError) {
const statusCode = HttpStatus.UNPROCESSABLE_ENTITY;
Expand Down
80 changes: 0 additions & 80 deletions src/common/middleware/axios.middleware.ts

This file was deleted.

Loading

0 comments on commit 965a381

Please sign in to comment.