(data, statusCode)
| 422 | } |
| 423 | |
| 424 | function safeHubErrorCode(data, statusCode) { |
| 425 | const candidates = [ |
| 426 | data?.error, |
| 427 | data?.reason, |
| 428 | data?.payload?.error, |
| 429 | data?.payload?.reason, |
| 430 | ]; |
| 431 | for (const value of candidates) { |
| 432 | if (typeof value !== 'string') continue; |
| 433 | const code = value.trim(); |
| 434 | if (/^[a-z][a-z0-9_:-]{0,79}$/i.test(code)) return code; |
| 435 | } |
| 436 | return `http_${statusCode}`; |
| 437 | } |
| 438 | |
| 439 | function normalizeNodeSecretEnvSuppression(value) { |
| 440 | const raw = String(value || '').trim(); |