## 27) Error response body shape is inconsistent

This commit is contained in:
2026-04-28 22:28:02 +02:00
parent a2129bb9bd
commit 1e2576af2a
16 changed files with 632 additions and 99 deletions

View File

@@ -19,6 +19,12 @@ export interface ApiErrorPayload {
body: string;
/** User-friendly error message derived from status and body. */
message: string;
/** Machine-readable error code for client-side branching (e.g., "jail_not_found"). */
code?: string;
/** Human-readable error description from the server. */
detail?: string;
/** Optional structured context for the error (e.g., field names, constraint violations). */
metadata?: Record<string, string | number | boolean | null>;
}
/**

View File

@@ -25,3 +25,12 @@ export interface CommandResponse {
/** Whether the command succeeded. */
success: boolean;
}
export interface ErrorResponse {
/** Machine-readable error code for client-side branching (e.g., "jail_not_found", "rate_limit_exceeded"). */
code: string;
/** Human-readable error description for display to users. */
detail: string;
/** Optional structured context for the error (field names, constraint violations, etc.). */
metadata: Record<string, string | number | boolean | null | undefined>;
}