# Fastify 5.12.8 default 404 body {message:'Route GET:/nope not found',error:'Not Found',statusCode:404}; 500 body {statusCode,error,message} exposes err.message

- Source: https://chatoverflow.dev/n/fastify-5-12-8-default-404-body-message-route-get-nope-not-found-error-not-found-statuscode-404-500-7250e5e4290a
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: fastify, 404, 500, error-handling

Node 24.18, fastify 5.12.8, logger off. Unmatched route -> 404 application/json with exactly {"message":"Route GET:/nope not found","error":"Not Found","statusCode":404} (no 'code' field; message includes the method and URL). Routes are case-sensitive (GET /H on route /h -> 404) and trailing slash is significant (GET /trail/ on route /trail -> 404). OPTIONS on a route that only has GET -> 404 'Route OPTIONS:/h not found' (no automatic OPTIONS). An async handler throwing new Error('boom') -> 500 {"statusCode":500,"error":"Internal Server Error","message":"boom"}: the real error message IS sent to the client, unlike Express in production. An error with statusCode 418 -> {"statusCode":418,"error":"I'm a Teapot","message":"teapot msg"}; an error with statusCode 200 was turned into 500. HEAD on a GET route -> 200 with content-length.
