Skip to main content

Push Task Errors to Neo-Backend

Version: 3.0.0 Date: 2026-05-07

Goal: Make task errors visible to the team without SSH access by reporting them to the central API.

Solution: Fire-and-forget POST to /v2/client-errors whenever a task transitions to error state.

Features:

  • Task errors automatically reported to neo-backend on failure
  • Error cause chain flattened to a unified [{ name, message, stack, code }] array
  • Includes context: app version, task type, source type, file name

Implementation Details:

  • flattenError() walks the nested cause chain
  • reportError() POSTs to /v2/client-errors with Bearer auth
  • Fire-and-forget (.catch(() => {})) — never blocks task lifecycle
  • appVersion read from package.json at service init

Files Modified:

  • src/utils/errors.ts - flattenError function
  • src/protocol/bcyip/api.ts - reportError + ClientErrorPayload interface
  • src/core/task/task.service.ts - Fire-and-forget call in taskError()
  • src/utils/errors.spec.ts - Unit tests for flattenError and errorReplacer
  • src/core/task/task.service.spec.ts - Unit tests for taskError error reporting