withastro
astro
BlogDocsChangelog

Return 404 for non-existent actions instead of 500

#14567Merged
Comparing
action-error
(
2cb169b
) with
main
(
73c5de9
)
CodSpeed Performance Gauge
0%
Untouched
6

Benchmarks

Passed

Rendering: streaming [true], .mdx file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
724.1 ms722.7 ms
Rendering: streaming [true], .astro file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
938.4 ms938.3 ms
Rendering: streaming [false], .astro file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
892.4 ms892.5 ms
Rendering: streaming [false], .mdx file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
717.3 ms717.6 ms
Rendering: streaming [true], .md file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
12.8 ms12.8 ms
Rendering: streaming [false], .md file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
12.9 ms12.9 ms

Commits

Click on a commit to change the comparison range
Base
main
73c5de9
+0.07%
Return 404 for non-existent actions instead of 500 When a POST request is made to a non-existent action endpoint, return a 404 response with NOT_FOUND error code instead of throwing an unhandled ActionNotFoundError. The fix catches ActionNotFoundError in the action handler and returns an ActionError with code 'NOT_FOUND', which automatically serializes to HTTP 404 status via the built-in codeToStatusMap. Closes #13549
da52bab
4 days ago
by matthewp
-0.1%
Update .changeset/graceful-actions-fix.md Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2cb169b
4 days ago
by matthewp
© 2025 CodSpeed Technology
Home Terms Privacy Docs