Improved exception handling, started work on improving error messages for IP bans
This commit is contained in:
parent
7d3c31f0aa
commit
853f67fe15
15 changed files with 118 additions and 77 deletions
|
|
@ -31,7 +31,7 @@ module.exports.post = async function(req, res){
|
|||
const channel = await channelModel.findOne({name: data.chanName});
|
||||
|
||||
if(channel == null){
|
||||
throw new Error("Chanenl does not exist!");
|
||||
throw loggerUtils.exceptionSmith("Chanenl does not exist!", "validation");
|
||||
}
|
||||
|
||||
await channel.nuke(data.confirm);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ module.exports.get = async function(req, res){
|
|||
|
||||
|
||||
if(channel == null){
|
||||
throw new Error("Channel not found.");
|
||||
throw loggerUtils.exceptionSmith("Channel not found.", "validation");
|
||||
}
|
||||
|
||||
res.status(200);
|
||||
|
|
@ -64,7 +64,7 @@ module.exports.post = async function(req, res){
|
|||
var permError = null;
|
||||
|
||||
if(chanDB == null){
|
||||
throw new Error("Channel not found.");
|
||||
throw loggerUtils.exceptionSmith("Channel not found.", "validation");
|
||||
}
|
||||
|
||||
//For each permission submitted
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ module.exports.get = async function(req, res){
|
|||
const channel = await channelModel.findOne({name: data.chanName});
|
||||
|
||||
if(channel == null){
|
||||
throw new Error("Channel not found.");
|
||||
throw loggerUtils.exceptionSmith("Channel not found.", "validation");
|
||||
}
|
||||
|
||||
res.status(200);
|
||||
|
|
@ -56,7 +56,7 @@ module.exports.post = async function(req, res){
|
|||
const settingsMap = new Map(Object.entries(data.settingsMap));
|
||||
|
||||
if(channel == null){
|
||||
throw new Error("Channel not found.");
|
||||
throw loggerUtils.exceptionSmith("Channel not found.", "validation");
|
||||
}
|
||||
|
||||
res.status(200);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ module.exports.get = async function(req, res){
|
|||
delete chanDB.permissions._doc._id;
|
||||
|
||||
if(chanDB == null){
|
||||
throw new Error("Channel not found.");
|
||||
throw loggerUtils.exceptionSmith("Channel not found.", "queue");
|
||||
}
|
||||
|
||||
return res.render('channelSettings', {instance: config.instanceName, user: req.session.user, channel: chanDB, reqRank, rankEnum: permissionModel.rankEnum, csrfToken: csrfUtils.generateToken(req)});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue