Refactor API and worker applications to use NestJS framework. Update package versions and scripts for improved functionality. Enhance TypeScript configurations and add new dependencies for better development support. Remove deprecated main.ts file from worker application.
This commit is contained in:
@@ -39,7 +39,8 @@ export class Rfc7807ExceptionFilter implements ExceptionFilter {
|
||||
instance: string,
|
||||
): ProblemDetails {
|
||||
if (exception instanceof HttpException) {
|
||||
const response = exception.getResponse();
|
||||
const httpException = exception;
|
||||
const response = httpException.getResponse();
|
||||
|
||||
if (typeof response === 'object' && response !== null) {
|
||||
const body = response as Record<string, unknown>;
|
||||
@@ -55,7 +56,7 @@ export class Rfc7807ExceptionFilter implements ExceptionFilter {
|
||||
|
||||
if (typeof body['message'] === 'string') {
|
||||
return createProblemDetails({
|
||||
title: exception.name,
|
||||
title: httpException.name,
|
||||
status,
|
||||
detail: body['message'],
|
||||
instance,
|
||||
@@ -68,7 +69,7 @@ export class Rfc7807ExceptionFilter implements ExceptionFilter {
|
||||
status,
|
||||
detail: 'Request validation failed',
|
||||
instance,
|
||||
errors: body['message'].map((message) => ({
|
||||
errors: body['message'].map((message: unknown) => ({
|
||||
message: String(message),
|
||||
})),
|
||||
});
|
||||
@@ -76,9 +77,9 @@ export class Rfc7807ExceptionFilter implements ExceptionFilter {
|
||||
}
|
||||
|
||||
return createProblemDetails({
|
||||
title: exception.name,
|
||||
title: httpException.name,
|
||||
status,
|
||||
detail: exception.message,
|
||||
detail: httpException.message,
|
||||
instance,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user