diff --git a/src/plugins/serve-files.js b/src/plugins/serve-files.js index 11bfaac53ba07e6fa868806148703fbd1e561e66..4ec1469b9c2fd6bf6f0a1dbc143d25168440db07 100644 --- a/src/plugins/serve-files.js +++ b/src/plugins/serve-files.js @@ -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 } })