Skip to content

fix: use NestJS HTTP exceptions in vouching service #68

Description

@EmeditWeb

Problem

The vouching service (lines 51, 78, 147, 165, 184) throws new Error(...) instead of NestJS HTTP exceptions like new InternalServerErrorException(...). These will result in unformatted 500 responses with no structured error code.

User impact: API clients receive inconsistent error formats (plain text 500 vs structured JSON).

Root Cause

Error handling was not updated to use NestJS patterns.

What To Build

  1. Replace all new Error(...) with appropriate NestJS HTTP exceptions
  2. Use NotFoundException, BadRequestException, InternalServerErrorException as appropriate
  3. Verify same issue in vendors.service.ts (line 63)

Files To Touch

  • src/modules/vouching/vouching.service.ts — fix error handling
  • src/modules/vendors/vendors.service.ts — line 63 fix error handling

Acceptance Criteria

  • All errors use NestJS HTTP exceptions
  • API returns structured JSON error responses
  • Build passes

Mandatory Checks

  • context/ files read
  • npm run build passes
  • PR references this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions