Files
goodgo-platform/e2e/api
Ho Ngoc Hai 50b2eea4a2 fix(listings): return 404 instead of 500 for non-existent listing detail
Move not-found handling from the query handler to the controller layer
following DDD conventions: the handler now returns null when a listing
is not found, and the controller maps that to NotFoundException (404).

Key changes:
- Handler returns ListingDetailData | null instead of throwing
- Use ListingNotFoundSignal to prevent caching null results
- Add `return await` to properly catch errors in try/catch
- Controller throws NotFoundException with listing ID in message
- Strengthen E2E test to assert exactly 404 (was [404, 400])
- Add unit tests: not-found returns null, unexpected error → 500
- Fix missing LoggerService mock in handler test

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-13 00:21:42 +07:00
..