Skip to main content
Version: 3.2.0

feat-error-handling

⚡ Improvements​

Actionable protect, proof and init errors​

Goal: Operators were seeing Node stacks, Request failed with status code 404, or [object Object] when a protect/proof job or a webhook/FTP init failed — no URL, no neo body, no git stderr.

Solution: One normalizeError pipeline (Axios, exec, HttpException, unknown) with secret redaction. Persist that shape on the task, return 400 on /protect instead of a silent 200, and show message first in task details and the init report (stack stays secondary). serializeError for SSE now delegates to the same normalizer (covers BCYIP-806 without a Nest interceptor).

Features:

  • Task details: headline + optional stack accordion and copy
  • Init report: message before stack
  • Webhook/FTP init errors on the SSE stream are JSON-serializable and redacted

Implementation Details:

  • sendFile / protect failures go through taskError → normalized { message, stack }
  • Secrets in URLs, remotes and stderr are redacted before persist / log / UI
  • Heartbeat / neo-unreachable banner is still product, out of this change

Files Modified:

  • src/utils/normalize-error.ts - shared normalizer + redaction
  • src/utils/normalize-error.spec.ts - Axios, exec, errno-like objects, secrets
  • src/protocol/bcyip/api.ts - wrap neo HTTP failures
  • src/app.service.ts - executeCmds via toError
  • src/core/task/task.service.ts - taskError persists a normalized error
  • src/core/task/task.types.ts - persisted error shape
  • src/core/logger/logger.service.ts - cleanData uses the normalizer
  • src/app.controller.ts - POST /protect logs and returns 400
  • src/app.controller.protect.spec.ts - webhook protect returns 400 with normalized message
  • src/core/task/task.service.spec.ts - taskError persists redacted headline
  • src/protocol/capacities/webhook-capacity/webhook-capacity.service.ts - serializeError delegates to normalizeError
  • src/protocol/capacities/webhook-capacity/webhook-capacity.service.spec.ts - serializeError coverage
  • ui/src/pages/dashboard/tasks.types.ts - ErrorStage fields optional to match API (stack, message, ts, archived)
  • ui/src/components/atoms/TaskStageError.tsx - task error display
  • ui/src/components/atoms/TaskStageError.test.tsx - headline / stack / clipboard copy
  • ui/src/pages/dashboard/taskDetails/GitTaskDetails.tsx - use TaskStageError
  • ui/src/pages/dashboard/taskDetails/FtpTaskDetails.tsx - use TaskStageError
  • ui/src/pages/settings/report/SourceGroupReport.tsx - resolveErrorText (message || stack)
  • ui/src/pages/settings/report/SourceGroupReport.errorText.test.tsx - prefers message over stack
  • ui/src/pages/settings/report/UnitActionReport.tsx - same for standalone init units
  • docs/error-handling.md - design + implementation status