Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/common/utils/startup-app/extra-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const internalServerErrors = Object.values(ERRORS).filter(

export class RemnawaveNotFoundErrorDto extends createZodDto(
z.object({
timestamp: z.string().describe('Time when the error occurred, in ISO 8601 format.'),
timestamp: z.iso
.datetime({ local: true, offset: true })
.describe('Time when the error occurred, in ISO 8601 format.'),
path: z.string().describe('Path of the request that caused the error.'),
message: z
.enum(notFoundErrors.map((error) => error.message) as [string, ...string[]])
Expand All @@ -70,7 +72,9 @@ export class RemnawaveNotFoundErrorDto extends createZodDto(

export class RemnawaveBadRequestErrorDto extends createZodDto(
z.object({
timestamp: z.string().describe('Time when the error occurred, in ISO 8601 format.'),
timestamp: z.iso
.datetime({ local: true, offset: true })
.describe('Time when the error occurred, in ISO 8601 format.'),
path: z.string().describe('Path of the request that caused the error.'),
message: z
.enum(badRequestErrors.map((error) => error.message) as [string, ...string[]])
Expand Down Expand Up @@ -106,7 +110,9 @@ export class RemnawaveValidationErrorDto extends createZodDto(

export class RemnawaveInternalServerErrorDto extends createZodDto(
z.object({
timestamp: z.string().describe('Time when the error occurred, in ISO 8601 format.'),
timestamp: z.iso
.datetime({ local: true, offset: true })
.describe('Time when the error occurred, in ISO 8601 format.'),
path: z.string().describe('Path of the request that caused the error.'),
message: z
.enum(internalServerErrors.map((error) => error.message) as [string, ...string[]])
Expand Down