Skip to main content

Task Error Reporting

Overview

When a Tower task transitions to the error state, the error is automatically reported to neo-backend (POST /v2/client-errors) so the team can investigate without needing SSH access to the server.

How it works

  1. When taskError() is called in TaskService, a fire-and-forget POST is sent to neo-backend.
  2. The error's nested cause chain is flattened into a [{ name, message, stack, code }] array.
  3. The payload includes context: app version (read from package.json at service init), task type, source type, and file name.
  4. The call never blocks the task lifecycle — errors in the reporting itself are silently swallowed.

Key files

  • src/utils/errors.tsflattenError() function
  • src/protocol/bcyip/api.tsreportError() + ClientErrorPayload interface
  • src/core/task/task.service.ts — Fire-and-forget call in taskError()

Technical decisions

  • Fire-and-forget (.catch(() => {})) to ensure task lifecycle is never affected by reporting failures.
  • appVersion is read once at service init from package.json to avoid repeated disk reads.