Skip to content

Commit

Permalink
Fix level data status code on error (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSpicyBurrito authored Sep 4, 2024
1 parent 1c79b8b commit c350e7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sonolus/level/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { sonolus } from '../index.js'
const cachePath = resolve('./cache', 'LevelData', version)

export const installLevelData = () => {
sonolus.router.get('/sonolus/levels/:name/data', (req, res, next) => {
sonolus.router.get('/sonolus/levels/:name/data', (req, res) => {
const item = sonolus.level.items.find(({ name }) => name === req.params.name)
if (!item) {
res.status(404).end()
Expand All @@ -38,7 +38,7 @@ export const installLevelData = () => {
await writeFile(path, buffer)
} catch (error) {
console.error(error)
next()
res.status(500).end()
}
})
})
Expand Down

0 comments on commit c350e7d

Please sign in to comment.