## 27) Error response body shape is inconsistent
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user