Skip to content

Commit

Permalink
remove unused error init
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Feb 3, 2024
1 parent 49c761f commit fea7e75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function fastifyStatic (fastify, opts) {
try {
const hashesContent = await readFile(hashesFilePath, 'utf8')
fastify[kFileHashes] = new Map(Object.entries(JSON.parse(hashesContent)))
} catch (err) {
} catch {
fastify[kFileHashes] = await generateHashes(opts.root, opts.serveDotFiles, opts.hashSkip)
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/static.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,11 @@ t.test('register /static with hash prebuilt hashes', (t) => {
root: [path.join(__dirname, '/static')],
prefix: '/static/',
hash: true,
serveDotFiles: true,
wildcard: false
}

generateHashes(pluginOptions.root, true, [], true).then(() => {
generateHashes(pluginOptions.root, true, undefined, true).then(() => {
const fastify = Fastify()
fastify.register(fastifyStatic, pluginOptions)
t.teardown(fastify.close.bind(fastify))
Expand Down

0 comments on commit fea7e75

Please sign in to comment.