Skip to content

Commit

Permalink
correct error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaFrncJrg committed Feb 11, 2025
1 parent 6613d86 commit a32352a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/xo-server/src/xo-mixins/rest-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,11 +1523,7 @@ export default class RestApi {
await app.deleteGroup(req.params.id)
res.sendStatus(204)
} catch (error) {
if (!noSuchObject.is(error) && !featureUnauthorized.is(error)) {
return res.status(500).json({ message: 'Internal server error' })
}

throw error
return res.status(404).json({ message: error.message })
}
}, true)
)
Expand Down

0 comments on commit a32352a

Please sign in to comment.