forked from Shared/esg
initial commit
This commit is contained in:
19
src/common/dto/normalized-error.dto.ts
Normal file
19
src/common/dto/normalized-error.dto.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
|
||||
/**
|
||||
* Standardized error shape returned to API consumers
|
||||
* regardless of upstream provider error formats.
|
||||
*/
|
||||
export class NormalizedErrorDto {
|
||||
@ApiProperty({ example: 'PROVIDER_TIMEOUT' })
|
||||
code!: string;
|
||||
|
||||
@ApiProperty({ example: 'Provider request timed out' })
|
||||
message!: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'سرویس در دسترس نیست' })
|
||||
providerMessage?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: '503' })
|
||||
providerCode?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user