@upv/ushi-shared
Version:
Shared DTOs, types, and utilities for the USHI platform (LMS, Trials, Social, Wallet).
26 lines (25 loc) • 699 B
TypeScript
export declare enum ApiErrorCode {
UNAUTHORIZED = "unauthorized",
FORBIDDEN = "forbidden",
NOT_FOUND = "not_found",
VALIDATION_FAILED = "validation_failed",
CONFLICT = "conflict",
BAD_REQUEST = "bad_request",
INTERNAL_ERROR = "internal_error",
NOT_IMPLEMENTED = "not_implemented",
SERVICE_UNAVAILABLE = "service_unavailable",
UNKNOWN = "unknown_error"
}
export interface ApiErrorContext {
path?: string;
method?: string;
fieldErrors?: Record<string, string>;
correlationId?: string;
[key: string]: any;
}
export interface ApiError {
code: ApiErrorCode;
message: string;
statusCode: number;
context?: Record<string, any>;
}