fix(deploy-tests): preserve API refusal details

Merged
SO
1d ago
+269-6

When a deployment API request fails, the test client currently reports only the HTTP status and error code, hiding the reason the host returned. Include the API message in a single log line capped at 2,048 characters, redact authentication tokens and known secret environment values, and preserve the existing malformed-response fallback and retry decisions. Keep the original API error as the cause of the friendly unsupported-Next.js explanation.

Validation: 16 focused fetch-stub tests passed; ESLint and formatting checks passed for the changed files. No live deployment tests or benchmarks were run.


Summary by cubic

When a deployment API request fails, the test client now reports the host's reason in the error message instead of only the HTTP status and error code. The message stays a single log line capped at 2,048 characters, with authentication tokens and known secret environment values redacted. Malformed-response handling and retry decisions are unchanged, and the original API error is preserved as the cause of the friendly unsupported-Next.js explanation.

  • refusalOf now reads the message field from the API error body and includes it in the ApiError message.
  • Secret values are collected from the auth token and from environment entries (both sent and fetched) before the message is normalized and redacted.
  • The unsupported-Next.js explanation in deploy.ts now chains the underlying API error as its cause.