Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Backend
/
Elysia
Why prefer `return status(404, payload)` when a route declares a `404` response schema?
from Elysia
Elysia 1.4.30 / Bun 1.3.10 / TypeScript 6
intermediate
1 min
Why prefer `return status(404, payload)` when a route declares a `404` response schema?
It binds the status to the payload so TypeScript can check and narrow that response branch.
It retries the handler automatically after every 404.
It skips response validation to reduce latency.
It converts every thrown exception into the same payload.
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in Elysia route typing
Spot the bug
A new version is available
Reload