Skip to content

feat(api): BA-119 map unmatched routes to consistent shared not-found API error responses - #1045

Open
ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/not-found-responses-1032
Open

ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/not-found-responses-1032

Conversation

@ranjeetprabhatedu-dotcom

Copy link
Copy Markdown

Summary

This PR implements BA-119 to ensure unmatched routes return consistent, structured JSON not-found error responses conforming to the shared API format.

  • Implements NotFoundExceptionFilter in app.module.ts to intercept NotFoundException and format responses with { statusCode: 404, error: 'Not Found', message, path, timestamp }.
  • Binds NotFoundExceptionFilter as APP_FILTER in AppModule and globally in main.ts.
  • Adds unit test suite in app.controller.spec.ts verifying unmatched route payloads, status code 404, path reporting, and fallback handling when request URL is absent.
  • Scoped strictly to the 3 allowlisted files:
    • BackendAcademy/src/main.ts
    • BackendAcademy/src/app.module.ts
    • BackendAcademy/src/app.controller.spec.ts

Closes #1032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BA-119 — Return consistent not-found responses for unknown routes

1 participant