Skip to content
Snippets Groups Projects
Commit 3044c7bb authored by richard.petersen's avatar richard.petersen :sailboat: Committed by julian.baeume
Browse files

Improve "file not found" error message

parent 9dbf03d0
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ export default async function serveFilePlugin (fastify, options) {
} catch (err) {
const errors = err.errors || [err]
const fileNotFound = errors.reduce((memo, error) => memo && error instanceof NotFoundError, true)
if (fileNotFound) throw createError(404, 'File does not exist.')
if (fileNotFound) throw createError(404, `File "${req.urlData('path')}" does not exist.`)
throw err
}
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment