feat: establish backend foundation
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { ApiInternalServerErrorResponse, ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class SafeErrorResponseDto {
|
||||
@ApiProperty({ example: 500 })
|
||||
statusCode: number;
|
||||
|
||||
@ApiProperty({ example: 'Internal server error' })
|
||||
message: string;
|
||||
|
||||
@ApiProperty({ example: '/api/v1' })
|
||||
path: string;
|
||||
}
|
||||
|
||||
export function ApiSafeErrorResponse(): MethodDecorator & ClassDecorator {
|
||||
return ApiInternalServerErrorResponse({
|
||||
description: 'Internal server error',
|
||||
type: SafeErrorResponseDto,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user