Add exception handler to all controllers.
This commit is contained in:
parent
cf55be21eb
commit
1de507b7cb
7 changed files with 42 additions and 34 deletions
|
|
@ -16,6 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
|
||||
//Config
|
||||
const config = require('../../config.json');
|
||||
|
||||
//local imports
|
||||
const {exceptionHandler} = require('../utils/loggerUtils.js');
|
||||
const channelModel = require('../schemas/channelSchema');
|
||||
|
||||
//root index functions
|
||||
|
|
@ -30,7 +33,6 @@ module.exports.get = async function(req, res){
|
|||
|
||||
return res.render('channelSettings', {instance: config.instanceName, user: req.session.user, channel});
|
||||
}catch(err){
|
||||
res.status(500);
|
||||
res.send(err.message);
|
||||
return exceptionHandler(res, err);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue