mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-01-25 02:08:24 +00:00
fix unhandled exception (#473)
* handle error and return 400 * Update accounts.js * Update accounts.js * new test passing
This commit is contained in:
@@ -286,7 +286,11 @@ const hasAccountPermissions = async(req, res, next) => {
|
||||
message: 'insufficient privileges'
|
||||
});
|
||||
} catch (error) {
|
||||
throw error;
|
||||
// return 400 on errors
|
||||
res.status(400).json({
|
||||
status: 'fail',
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user