Skip to content

Error handler: errorHandler never leaks internal messages; sanitize and lib/errors parity [RC26Q2-B27] #258

@thlpkee20-wq

Description

@thlpkee20-wq

Description

Error handler: errorHandler never leaks internal messages; sanitize and lib/errors parity — target TypeScript/Express in Revora-Backend (Stellar/Horizon + Soroban on the chain leg). Add tests, structured logging, and lib/errors style responses. Backend scope only, not the React app.

Requirements and context

  • ≥95% coverage for new or materially changed lines; follow existing Jest/TS test layout.
  • No raw upstream/DB error strings in client-facing JSON; align with security modules.

Suggested execution

  • Fork the repo, then:

    • git checkout -b be27-error-handler
  • Relevant modules: Per title; src/services/, src/routes/, src/middleware/, src/lib/, src/db/ as applicable.

  • Implement and verify

    • Branch: git checkout -b be27-error-handler
    • Touch the listed modules; extend *.test.ts co-located with implementation.
    • If Stellar RPC is involved, document classifyStellarRPCFailure behavior in the PR; link stellar.test and stellarRpcFailure usage.
    • Run full npm test / yarn test as used by the repo; paste summary; add security assumptions note.
  • Test and document

    • Add or extend automated tests; cover edge cases and invariants
    • Document security assumptions; include test output summary and a short security / risk note in the PR
    • For Revora-Contracts (Soroban): cargo test, cargo clippy, rustdoc/NatSpec-style entrypoint docs where applicable. Do not implement Solidity; this work targets Rust/WASM in this repository.
    • For Backend / Frontend: follow the repo’s existing Jest/TS/ESLint/Vite setup.
    • Example commit message: fix(backend): error handler

Labels and GitHub label colors

  • Create the labels in this issue’s labels: line under Settings → Labels in the target repo.
  • Assign distinct colors (avoid all grey): e.g. #0052CC (blue, platform), #B60205 (red, security), #0E8A16 (green, tests), #5319E7 (purple, P1), #F9D0C4 (scope), #1D76DB (api), #BFD4F2 (docs) — pick a non-default palette so issues are scannable in the board.

Guidelines

  • Target ≥ 95% test coverage for new or materially changed code paths
  • Clear, linked documentation in-repo
  • Timeframe: 96 hours from assignment

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions