/** * Palantir Foundry API error types and codes. * Covers all documented v2 error names, OAuth2 endpoint errors, and general HTTP status codes. * @see https://www.palantir.com/docs/foundry/api/v2/general/overview/errors */ // ─── Error Codes (Palantir string codes) ──────────────────────────── export const PalantirErrorCode = { INVALID_ARGUMENT: "INVALID_ARGUMENT", UNAUTHORIZED: "UNAUTHORIZED", PERMISSION_DENIED: "PERMISSION_DENIED", NOT_FOUND: "NOT_FOUND", CONFLICT: "CONFLICT", INTERNAL: "INTERNAL", TIMEOUT: "TIMEOUT", } as const; export type PalantirErrorCode = (typeof PalantirErrorCode)[keyof typeof PalantirErrorCode]; // ─── Error Names — General ────────────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/general/overview/errors export const GeneralErrorName = { ApiFeaturePreviewUsageOnly: "ApiFeaturePreviewUsageOnly", ApiUsageDenied: "ApiUsageDenied", ConjureInvalidArgument: "Conjure:InvalidArgument", ConjureUnprocessableEntity: "Conjure:UnprocessableEntity", ConjureUnsupportedMediaType: "Conjure:UnsupportedMediaType", DefaultInternal: "Default:Internal", DefaultPermissionDenied: "Default:PermissionDenied", DefaultUnauthorized: "Default:Unauthorized", InvalidPageSize: "InvalidPageSize", InvalidPageToken: "InvalidPageToken", InvalidParameterCombination: "InvalidParameterCombination", MissingCredentials: "MissingCredentials", } as const; export type GeneralErrorName = (typeof GeneralErrorName)[keyof typeof GeneralErrorName]; // ─── Error Names — Ontologies ─────────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/ontologies-v2-resources/ export const OntologyErrorName = { ActionEditedPropertiesNotFound: "ActionEditedPropertiesNotFound", ActionParameterObjectTypeNotFound: "ActionParameterObjectTypeNotFound", ActionParameterObjectNotFound: "ActionParameterObjectNotFound", ActionTypeNotFound: "ActionTypeNotFound", ActionValidationFailed: "ActionValidationFailed", AggregationGroupCountExceededLimit: "AggregationGroupCountExceededLimit", ApplyActionFailed: "ApplyActionFailed", AttachmentNotFound: "AttachmentNotFound", AttachmentSizeExceededLimit: "AttachmentSizeExceededLimit", CompositePrimaryKeyNotSupported: "CompositePrimaryKeyNotSupported", DuplicateOrderBy: "DuplicateOrderBy", FunctionEncounteredUserFacingError: "FunctionEncounteredUserFacingError", FunctionInvalidInput: "FunctionInvalidInput", FunctionExecutionTimedOut: "FunctionExecutionTimedOut", InvalidContentLength: "InvalidContentLength", InvalidContentType: "InvalidContentType", InvalidDurationGroupByValue: "InvalidDurationGroupByValue", InvalidDurationGroupByPropertyType: "InvalidDurationGroupByPropertyType", InvalidFields: "InvalidFields", InvalidGroupId: "InvalidGroupId", InvalidParameterValue: "InvalidParameterValue", InvalidPropertyFiltersCombination: "InvalidPropertyFiltersCombination", InvalidPropertyType: "InvalidPropertyType", InvalidPropertyValue: "InvalidPropertyValue", InvalidSortOrder: "InvalidSortOrder", InvalidSortType: "InvalidSortType", InvalidUserId: "InvalidUserId", LinkAlreadyExists: "LinkAlreadyExists", LinkedObjectNotFound: "LinkedObjectNotFound", LinkTypeNotFound: "LinkTypeNotFound", MalformedPropertyFilters: "MalformedPropertyFilters", MultiplePropertyValuesNotSupported: "MultiplePropertyValuesNotSupported", ObjectNotFound: "ObjectNotFound", ObjectsExceededLimit: "ObjectsExceededLimit", ObjectTypeNotFound: "ObjectTypeNotFound", ObjectTypeNotSynced: "ObjectTypeNotSynced", OntologyEditsExceededLimit: "OntologyEditsExceededLimit", OntologyNotFound: "OntologyNotFound", OntologySyncing: "OntologySyncing", ParametersNotFound: "ParametersNotFound", ParameterTypeNotSupported: "ParameterTypeNotSupported", PropertiesNotFound: "PropertiesNotFound", PropertiesNotSearchable: "PropertiesNotSearchable", PropertiesNotSortable: "PropertiesNotSortable", PropertyApiNameNotFound: "PropertyApiNameNotFound", PropertyBaseTypeNotSupported: "PropertyBaseTypeNotSupported", PropertyFiltersNotSupported: "PropertyFiltersNotSupported", QueryEncounteredUserFacingError: "QueryEncounteredUserFacingError", QueryRuntimeError: "QueryRuntimeError", QueryTimeExceededLimit: "QueryTimeExceededLimit", QueryMemoryExceededLimit: "QueryMemoryExceededLimit", ViewObjectPermissionDenied: "ViewObjectPermissionDenied", } as const; export type OntologyErrorName = (typeof OntologyErrorName)[keyof typeof OntologyErrorName]; // ─── Error Names — Datasets ───────────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/datasets-v2-resources/ export const DatasetErrorName = { AbortTransactionPermissionDenied: "AbortTransactionPermissionDenied", BranchAlreadyExists: "BranchAlreadyExists", BranchNotFound: "BranchNotFound", ColumnTypesNotSupported: "ColumnTypesNotSupported", CommitTransactionPermissionDenied: "CommitTransactionPermissionDenied", CreateBranchPermissionDenied: "CreateBranchPermissionDenied", CreateDatasetPermissionDenied: "CreateDatasetPermissionDenied", CreateTransactionPermissionDenied: "CreateTransactionPermissionDenied", DatasetNotFound: "DatasetNotFound", DatasetReadNotSupported: "DatasetReadNotSupported", ReadTableRowLimitExceeded: "ReadTableRowLimitExceeded", GetDatasetSchemaPermissionDenied: "GetDatasetSchemaPermissionDenied", DeleteBranchPermissionDenied: "DeleteBranchPermissionDenied", FileAlreadyExists: "FileAlreadyExists", FileNotFoundOnBranch: "FileNotFoundOnBranch", FileNotFoundOnTransactionRange: "FileNotFoundOnTransactionRange", InvalidBranchId: "InvalidBranchId", InvalidTransactionType: "InvalidTransactionType", OpenTransactionAlreadyExists: "OpenTransactionAlreadyExists", ReadTablePermissionDenied: "ReadTablePermissionDenied", SchemaNotFound: "SchemaNotFound", TransactionNotCommitted: "TransactionNotCommitted", TransactionNotFound: "TransactionNotFound", TransactionNotOpen: "TransactionNotOpen", UploadFilePermissionDenied: "UploadFilePermissionDenied", } as const; export type DatasetErrorName = (typeof DatasetErrorName)[keyof typeof DatasetErrorName]; // ─── Error Names — Filesystems ────────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/filesystem-v2-resources/ export const FilesystemErrorName = { FolderNotFound: "FolderNotFound", ResourceNameAlreadyExists: "ResourceNameAlreadyExists", ResourceNotFound: "ResourceNotFound", InvalidFolder: "InvalidFolder", GetRootFolderNotSupported: "GetRootFolderNotSupported", GetSpaceResourceNotSupported: "GetSpaceResourceNotSupported", CreateFolderOutsideProjectNotSupported: "CreateFolderOutsideProjectNotSupported", CreateFolderPermissionDenied: "CreateFolderPermissionDenied", PathNotFound: "PathNotFound", InvalidPath: "InvalidPath", GetByPathPermissionDenied: "GetByPathPermissionDenied", } as const; export type FilesystemErrorName = (typeof FilesystemErrorName)[keyof typeof FilesystemErrorName]; // ─── Error Names — Operations ─────────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/operations-v2-resources/ export const OperationErrorName = { OperationNotFound: "OperationNotFound", } as const; // ─── Error Names — AIP Agents ────────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/aip-agents-v2-resources/ export const AipErrorName = { ContextSizeExceededLimit: "ContextSizeExceededLimit", AgentIterationsExceededLimit: "AgentIterationsExceededLimit", RateLimitExceeded: "RateLimitExceeded", RetryAttemptsExceeded: "RetryAttemptsExceeded", AgentNotFound: "AgentNotFound", SessionNotFound: "SessionNotFound", SessionExpired: "SessionExpired", InvalidUserMessage: "InvalidUserMessage", ModelNotAvailable: "ModelNotAvailable", ContentNotFound: "ContentNotFound", CancelSessionFailedMessageNotInProgress: "CancelSessionFailedMessageNotInProgress", BlockingContinueSessionPermissionDenied: "BlockingContinueSessionPermissionDenied", StreamingContinueSessionPermissionDenied: "StreamingContinueSessionPermissionDenied", } as const; export type OperationErrorName = (typeof OperationErrorName)[keyof typeof OperationErrorName]; export type AipErrorName = (typeof AipErrorName)[keyof typeof AipErrorName]; // ─── Error Names — Connectivity ───────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/connectivity-v2-resources/ export const ConnectivityErrorName = { ConnectionNotFound: "ConnectionNotFound", ConnectionTypeNotSupported: "ConnectionTypeNotSupported", CreateConnectionPermissionDenied: "CreateConnectionPermissionDenied", GetConfigurationPermissionDenied: "GetConfigurationPermissionDenied", ParentFolderNotFoundForConnection: "ParentFolderNotFoundForConnection", PropertyCannotBeBlank: "PropertyCannotBeBlank", UnknownWorkerCannotBeUsedForCreatingOrUpdatingConnections: "UnknownWorkerCannotBeUsedForCreatingOrUpdatingConnections", } as const; export type ConnectivityErrorName = (typeof ConnectivityErrorName)[keyof typeof ConnectivityErrorName]; // ─── Error Names — Admin ──────────────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/admin-v2-resources/ export const AdminErrorName = { UserNotFound: "UserNotFound", UserDeleted: "UserDeleted", UserIsActive: "UserIsActive", GroupNotFound: "GroupNotFound", OrganizationNotFound: "OrganizationNotFound", CreateOrganizationPermissionDenied: "CreateOrganizationPermissionDenied", OrganizationNameAlreadyExists: "OrganizationNameAlreadyExists", PrincipalNotFound: "PrincipalNotFound", EnrollmentNotFound: "EnrollmentNotFound", GetCurrentUserPermissionDenied: "GetCurrentUserPermissionDenied", RevokeAllTokensUserPermissionDenied: "RevokeAllTokensUserPermissionDenied", SearchUsersPermissionDenied: "SearchUsersPermissionDenied", ReplaceOrganizationPermissionDenied: "ReplaceOrganizationPermissionDenied", InvalidHostName: "InvalidHostName", CreateOrganizationMissingInitialAdminRole: "CreateOrganizationMissingInitialAdminRole", AddOrganizationRoleAssignmentsPermissionDenied: "AddOrganizationRoleAssignmentsPermissionDenied", } as const; export type AdminErrorName = (typeof AdminErrorName)[keyof typeof AdminErrorName]; // ─── Error Names — Orchestration ──────────────────────────────────── // @see https://www.palantir.com/docs/foundry/api/v2/orchestration-v2-resources/ export const OrchestrationErrorName = { ScheduleNotFound: "ScheduleNotFound", CreateSchedulePermissionDenied: "CreateSchedulePermissionDenied", RunSchedulePermissionDenied: "RunSchedulePermissionDenied", ReplaceSchedulePermissionDenied: "ReplaceSchedulePermissionDenied", DeleteSchedulePermissionDenied: "DeleteSchedulePermissionDenied", } as const; export type OrchestrationErrorName = (typeof OrchestrationErrorName)[keyof typeof OrchestrationErrorName]; // ─── OAuth2 Endpoint Error Codes ──────────────────────────────────── export const OAuth2ErrorCode = { invalid_request: "invalid_request", invalid_client: "invalid_client", invalid_grant: "invalid_grant", unauthorized_client: "unauthorized_client", access_denied: "access_denied", unsupported_response_type: "unsupported_response_type", invalid_scope: "invalid_scope", server_error: "server_error", temporarily_unavailable: "temporarily_unavailable", } as const; export type OAuth2ErrorCode = (typeof OAuth2ErrorCode)[keyof typeof OAuth2ErrorCode]; // ─── All Palantir Error Names Union ───────────────────────────────── export type PalantirErrorName = | GeneralErrorName | OntologyErrorName | DatasetErrorName | FilesystemErrorName | OperationErrorName | AipErrorName | ConnectivityErrorName | AdminErrorName | OrchestrationErrorName; // ─── Palantir API Error Response Shape ────────────────────────────── export interface PalantirApiErrorBody { errorCode: PalantirErrorCode; /** Palantir error name. Known names are in the ErrorName constants; unknown names are possible. */ errorName: string; errorInstanceId: string; parameters?: Record; } // ─── OAuth2 Token Error Response ──────────────────────────────────── export interface OAuth2TokenErrorBody { error: OAuth2ErrorCode; error_description: string; error_uri?: string; } // ─── PalantirApiError (thrown by client) ──────────────────────────── export class PalantirApiError extends Error { readonly errorCode: PalantirErrorCode; readonly errorName: string; readonly errorInstanceId: string; readonly statusCode: number; readonly parameters?: Record; constructor(body: PalantirApiErrorBody, statusCode: number) { const message = `${body.errorName} (${body.errorCode}): ${describeError(body.errorName)}`; super(message); this.name = "PalantirApiError"; this.errorCode = body.errorCode; this.errorName = body.errorName; this.errorInstanceId = body.errorInstanceId; this.statusCode = statusCode; this.parameters = body.parameters; } } // ─── Credential Errors (pre-flight) ───────────────────────────────── export class PalantirCredentialError extends Error { constructor(message: string) { super(message); this.name = "PalantirCredentialError"; } } export class PalantirOAuth2Error extends Error { readonly oauthErrorCode: OAuth2ErrorCode; readonly description: string; constructor(body: OAuth2TokenErrorBody) { super(`OAuth2 ${body.error}: ${body.error_description}`); this.name = "PalantirOAuth2Error"; this.oauthErrorCode = body.error; this.description = body.error_description; } } // ─── Error descriptions ───────────────────────────────────────────── function describeError(name: string): string { const descriptions: Record = { // General ApiFeaturePreviewUsageOnly: "Endpoint requires preview=true query parameter", ApiUsageDenied: "Token not authorized for this API endpoint", "Conjure:InvalidArgument": "One or more request arguments is invalid", "Conjure:UnprocessableEntity": "Request arguments could not be processed", "Conjure:UnsupportedMediaType": "Content-Type must be application/json", "Default:Internal": "Internal server error — retry or contact support", "Default:PermissionDenied": "Missing permission to complete request", "Default:Unauthorized": "Authorization token header is invalid", InvalidPageSize: "Page size must be greater than zero", InvalidPageToken: "Page token is invalid or expired", InvalidParameterCombination: "Parameters are individually valid but incompatible together", MissingCredentials: "Authorization token required but not provided", // Ontologies ActionEditedPropertiesNotFound: "Action tried to edit properties not found on object type", ActionParameterObjectTypeNotFound: "Parameter references object type not found or inaccessible", ActionParameterObjectNotFound: "Parameter object reference not found or inaccessible", ActionTypeNotFound: "Action type not found or inaccessible", ActionValidationFailed: "Action parameter validation failed", AggregationGroupCountExceededLimit: "Too many aggregation groups — use maxGroupCount or filter", ApplyActionFailed: "Action could not be applied to ontology", AttachmentNotFound: "Attachment not found or inaccessible", AttachmentSizeExceededLimit: "File exceeds 200MB attachment limit", CompositePrimaryKeyNotSupported: "Multi-property primary keys not supported", DuplicateOrderBy: "Sort order contains duplicate properties", FunctionEncounteredUserFacingError: "Function threw a user-facing error", FunctionInvalidInput: "Function received invalid input", FunctionExecutionTimedOut: "Function execution timed out", InvalidContentLength: "Content-Length header missing or invalid", InvalidContentType: "Content-Type cannot be inferred from request", InvalidDurationGroupByValue: "Duration groupBy value is invalid", InvalidDurationGroupByPropertyType: "Property does not support duration groupBy", InvalidFields: "Field values don't match expected pattern (use properties.{name})", InvalidGroupId: "Group ID must be a UUID", InvalidParameterValue: "Parameter value is invalid", InvalidPropertyFiltersCombination: "Provided filters cannot be used together", InvalidPropertyType: "Property type mismatch", InvalidPropertyValue: "Property value is invalid", InvalidSortOrder: "Sort order must be 'asc' or 'desc'", InvalidSortType: "Sort type must be 'properties' or 'p'", InvalidUserId: "User ID must be a UUID", LinkAlreadyExists: "Link already exists", LinkedObjectNotFound: "Linked object not found or inaccessible", LinkTypeNotFound: "Link type not found or inaccessible", MalformedPropertyFilters: "At least one filter is malformed", MultiplePropertyValuesNotSupported: "Property filter does not support multiple values", ObjectNotFound: "Object not found or inaccessible", ObjectsExceededLimit: "Exceeded 10,000 object limit for this request", ObjectTypeNotFound: "Object type not found or inaccessible", ObjectTypeNotSynced: "Object type not synced — re-index in Ontology Manager", OntologyEditsExceededLimit: "Too many edits in single action", OntologyNotFound: "Ontology not found or inaccessible", OntologySyncing: "Ontology changes being applied — retry shortly", ParametersNotFound: "Parameter IDs not recognized by action", ParameterTypeNotSupported: "Parameter type not supported", PropertiesNotFound: "Properties not found on object type", PropertiesNotSearchable: "Properties not marked as Searchable", PropertiesNotSortable: "Properties not marked as Sortable", PropertyApiNameNotFound: "Required property missing API name — set in Ontology Manager", PropertyBaseTypeNotSupported: "Property type not supported by API", PropertyFiltersNotSupported: "One or more property filters not supported", QueryEncounteredUserFacingError: "Query failed with user-induced error", QueryRuntimeError: "Query failed with runtime error", QueryTimeExceededLimit: "Query exceeded time limit", QueryMemoryExceededLimit: "Query exceeded memory limit", ViewObjectPermissionDenied: "Token lacks permission to view data sources for object type", // Datasets AbortTransactionPermissionDenied: "No permission to abort transaction on dataset", BranchAlreadyExists: "Branch with that name already exists", BranchNotFound: "Branch not found or inaccessible", ColumnTypesNotSupported: "Dataset contains unsupported column types", CommitTransactionPermissionDenied: "No permission to commit transaction on dataset", CreateBranchPermissionDenied: "No permission to create branch on dataset", CreateDatasetPermissionDenied: "No permission to create dataset in folder", CreateTransactionPermissionDenied: "No permission to create transaction on dataset", DatasetNotFound: "Dataset not found or inaccessible", DatasetReadNotSupported: "Dataset does not support read operation", ReadTableRowLimitExceeded: "Table read exceeded row limit (max 10 million rows)", GetDatasetSchemaPermissionDenied: "No permission to get dataset schema", DeleteBranchPermissionDenied: "No permission to delete branch on dataset", FileAlreadyExists: "File already exists in dataset and transaction", FileNotFoundOnBranch: "File not found on branch", FileNotFoundOnTransactionRange: "File not found on transaction range", InvalidBranchId: "Branch name invalid (empty, or looks like RID/UUID)", InvalidTransactionType: "Transaction type must be SNAPSHOT, UPDATE, APPEND, or DELETE", OpenTransactionAlreadyExists: "Branch already has an open transaction", ReadTablePermissionDenied: "No permission to read dataset as table", SchemaNotFound: "Schema not found for dataset/branch", TransactionNotCommitted: "Transaction has not been committed", TransactionNotFound: "Transaction not found or inaccessible", TransactionNotOpen: "Transaction is not open", UploadFilePermissionDenied: "No permission to upload file to dataset", // Filesystem FolderNotFound: "Folder not found or inaccessible", ResourceNameAlreadyExists: "Resource name already in use in same folder", ResourceNotFound: "Resource not found or inaccessible", InvalidFolder: "Folder RID is invalid", GetRootFolderNotSupported: "Root folder does not support this operation", GetSpaceResourceNotSupported: "Space resource does not support this operation", CreateFolderOutsideProjectNotSupported: "Cannot create folder outside of a project", CreateFolderPermissionDenied: "No permission to create folder in parent", PathNotFound: "Path not found or inaccessible", InvalidPath: "Path format is invalid", GetByPathPermissionDenied: "No permission to look up resource by path", // Operations OperationNotFound: "Operation not found or inaccessible", // AIP Agents — @see https://www.palantir.com/docs/foundry/api/v2/aip-agents-v2-resources/ ContextSizeExceededLimit: "Agent context window exceeded — reduce input size or history", AgentIterationsExceededLimit: "Agent exceeded maximum iteration count — simplify request", RateLimitExceeded: "AIP rate limit exceeded — retry after a delay", RetryAttemptsExceeded: "Agent retry attempts exhausted — check input or agent configuration", AgentNotFound: "AIP agent not found or inaccessible", SessionNotFound: "Session not found — it may have expired", SessionExpired: "Session has expired — create a new session", InvalidUserMessage: "User message is empty or invalid", ModelNotAvailable: "Requested language model is not available in this stack", ContentNotFound: "Session content could not be found", CancelSessionFailedMessageNotInProgress: "No in-progress exchange found to cancel for the given message identifier", BlockingContinueSessionPermissionDenied: "No permission to blockingContinue the session", StreamingContinueSessionPermissionDenied: "No permission to streamingContinue the session", // Connectivity — @see https://www.palantir.com/docs/foundry/api/v2/connectivity-v2-resources/ ConnectionNotFound: "Connection not found or inaccessible", ConnectionTypeNotSupported: "Connection type is not supported", CreateConnectionPermissionDenied: "No permission to create connection in folder", GetConfigurationPermissionDenied: "No permission to get connection configuration", ParentFolderNotFoundForConnection: "Parent folder not found for connection", PropertyCannotBeBlank: "A required property on the connection is blank", UnknownWorkerCannotBeUsedForCreatingOrUpdatingConnections: "Worker type is not recognized for this connection", // Admin — @see https://www.palantir.com/docs/foundry/api/v2/admin-v2-resources/ UserNotFound: "User not found or inaccessible", UserDeleted: "User has been deleted", UserIsActive: "User is already active — cannot reactivate", GroupNotFound: "Group not found or inaccessible", OrganizationNotFound: "Organization not found or inaccessible", CreateOrganizationPermissionDenied: "No permission to create organization", OrganizationNameAlreadyExists: "Organization display name already in use", PrincipalNotFound: "Principal (user or group) not found", EnrollmentNotFound: "Enrollment not found", GetCurrentUserPermissionDenied: "No permission to get current user", RevokeAllTokensUserPermissionDenied: "No permission to revoke all tokens for user", SearchUsersPermissionDenied: "No permission to search users", ReplaceOrganizationPermissionDenied: "No permission to replace organization", InvalidHostName: "Host name is invalid", CreateOrganizationMissingInitialAdminRole: "At least one administrator role grant required when creating organization", AddOrganizationRoleAssignmentsPermissionDenied: "No permission to add role assignments to organization", // Orchestration — @see https://www.palantir.com/docs/foundry/api/v2/orchestration-v2-resources/ ScheduleNotFound: "Schedule not found or inaccessible", CreateSchedulePermissionDenied: "No permission to create schedule", RunSchedulePermissionDenied: "No permission to trigger schedule run", ReplaceSchedulePermissionDenied: "No permission to replace schedule", DeleteSchedulePermissionDenied: "No permission to delete schedule", }; return descriptions[name] ?? "Unknown Palantir API error"; } // ─── HTTP Status Code Mappings ────────────────────────────────────── export const HttpStatus = { OK: 200, NO_CONTENT: 204, BAD_REQUEST: 400, UNAUTHORIZED: 401, FORBIDDEN: 403, NOT_FOUND: 404, CONFLICT: 409, UNPROCESSABLE_ENTITY: 422, URI_TOO_LONG: 414, UNSUPPORTED_MEDIA_TYPE: 415, TOO_MANY_REQUESTS: 429, HEADER_TOO_LARGE: 431, INTERNAL_SERVER_ERROR: 500, SERVICE_UNAVAILABLE: 503, GATEWAY_TIMEOUT: 504, } as const; export type HttpStatus = (typeof HttpStatus)[keyof typeof HttpStatus];