Skip to main content

ErrorResponseDTO

Package: @nauth-toolkit/core Type: DTO (Response)

Standardized error response format for all nauth-toolkit errors.

import { ErrorResponseDTO } from '@nauth-toolkit/nestjs';

Properties

PropertyTypeRequiredDescription
statusCodenumberYesHTTP status code (100-599).
codestringYesError code. Uppercase letters, numbers, underscores only. Max 100 characters.
messagestringYesHuman-readable error message. Max 500 characters.
detailsRecord<string, unknown>NoAdditional error metadata (retryAfter, field names, etc.).
timestampstringYesISO 8601 timestamp when error occurred.
pathstringNoRequest path where error occurred. Max 500 characters.

Example

{
"statusCode": 429,
"code": "RATE_LIMIT_SMS",
"message": "Too many verification SMS sent. Please try again later.",
"details": {
"retryAfter": 3600,
"currentCount": 4,
"maxAttempts": 3
},
"timestamp": "2025-10-31T01:43:03.132Z",
"path": "/auth/verify-phone/send"
}

Used By