2026-02-25 11:30:38 +09:00
|
|
|
/**
|
|
|
|
|
* Provider-specific error codes for structured error detection.
|
|
|
|
|
*
|
|
|
|
|
* These codes identify known error conditions from external providers.
|
|
|
|
|
* Used by provider error classes in the BFF to replace brittle string matching.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export const WhmcsProviderError = {
|
|
|
|
|
// Authentication
|
|
|
|
|
AUTH_FAILED: "WHMCS_AUTH_FAILED",
|
|
|
|
|
INVALID_CREDENTIALS: "WHMCS_INVALID_CREDENTIALS",
|
|
|
|
|
|
|
|
|
|
// Not found
|
|
|
|
|
CLIENT_NOT_FOUND: "WHMCS_CLIENT_NOT_FOUND",
|
|
|
|
|
INVOICE_NOT_FOUND: "WHMCS_INVOICE_NOT_FOUND",
|
|
|
|
|
PRODUCT_NOT_FOUND: "WHMCS_PRODUCT_NOT_FOUND",
|
|
|
|
|
|
|
|
|
|
// Validation
|
|
|
|
|
VALIDATION_ERROR: "WHMCS_VALIDATION_ERROR",
|
|
|
|
|
|
|
|
|
|
// Network/Infrastructure
|
|
|
|
|
TIMEOUT: "WHMCS_TIMEOUT",
|
|
|
|
|
NETWORK_ERROR: "WHMCS_NETWORK_ERROR",
|
|
|
|
|
RATE_LIMITED: "WHMCS_RATE_LIMITED",
|
|
|
|
|
HTTP_ERROR: "WHMCS_HTTP_ERROR",
|
|
|
|
|
|
|
|
|
|
// Generic
|
|
|
|
|
API_ERROR: "WHMCS_API_ERROR",
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
export type WhmcsProviderErrorCode = (typeof WhmcsProviderError)[keyof typeof WhmcsProviderError];
|
|
|
|
|
|
|
|
|
|
export const SalesforceProviderError = {
|
|
|
|
|
// Authentication
|
|
|
|
|
SESSION_EXPIRED: "SF_SESSION_EXPIRED",
|
|
|
|
|
AUTH_FAILED: "SF_AUTH_FAILED",
|
|
|
|
|
|
|
|
|
|
// Query
|
|
|
|
|
QUERY_ERROR: "SF_QUERY_ERROR",
|
|
|
|
|
RECORD_NOT_FOUND: "SF_RECORD_NOT_FOUND",
|
|
|
|
|
|
2026-02-25 14:33:19 +09:00
|
|
|
// Validation
|
|
|
|
|
VALIDATION_ERROR: "SF_VALIDATION_ERROR",
|
|
|
|
|
DUPLICATE_RECORD: "SF_DUPLICATE_RECORD",
|
|
|
|
|
ACCESS_DENIED: "SF_ACCESS_DENIED",
|
|
|
|
|
STORAGE_LIMIT: "SF_STORAGE_LIMIT",
|
|
|
|
|
|
2026-02-25 11:30:38 +09:00
|
|
|
// Network/Infrastructure
|
|
|
|
|
TIMEOUT: "SF_TIMEOUT",
|
|
|
|
|
NETWORK_ERROR: "SF_NETWORK_ERROR",
|
|
|
|
|
RATE_LIMITED: "SF_RATE_LIMITED",
|
|
|
|
|
|
|
|
|
|
// Generic
|
|
|
|
|
API_ERROR: "SF_API_ERROR",
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
export type SalesforceProviderErrorCode =
|
|
|
|
|
(typeof SalesforceProviderError)[keyof typeof SalesforceProviderError];
|
|
|
|
|
|
|
|
|
|
export const FreebitProviderError = {
|
2026-02-25 14:33:19 +09:00
|
|
|
// Not found
|
2026-02-25 11:30:38 +09:00
|
|
|
ACCOUNT_NOT_FOUND: "FREEBIT_ACCOUNT_NOT_FOUND",
|
2026-02-25 14:33:19 +09:00
|
|
|
|
|
|
|
|
// Authentication
|
|
|
|
|
AUTH_FAILED: "FREEBIT_AUTH_FAILED",
|
|
|
|
|
|
|
|
|
|
// Validation
|
|
|
|
|
VALIDATION_ERROR: "FREEBIT_VALIDATION_ERROR",
|
|
|
|
|
|
|
|
|
|
// Network/Infrastructure
|
2026-02-25 11:30:38 +09:00
|
|
|
TIMEOUT: "FREEBIT_TIMEOUT",
|
2026-02-25 14:33:19 +09:00
|
|
|
NETWORK_ERROR: "FREEBIT_NETWORK_ERROR",
|
|
|
|
|
RATE_LIMITED: "FREEBIT_RATE_LIMITED",
|
|
|
|
|
|
|
|
|
|
// Generic
|
2026-02-25 11:30:38 +09:00
|
|
|
API_ERROR: "FREEBIT_API_ERROR",
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
export type FreebitProviderErrorCode =
|
|
|
|
|
(typeof FreebitProviderError)[keyof typeof FreebitProviderError];
|