Add exception handler to all controllers.
This commit is contained in:
parent
cf55be21eb
commit
1de507b7cb
7 changed files with 42 additions and 34 deletions
|
|
@ -15,7 +15,8 @@ You should have received a copy of the GNU Affero General Public License
|
|||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||
|
||||
//local imports
|
||||
const channelModel = require('../../../schemas/channelSchema');
|
||||
const {exceptionHandler} = require('../../../utils/loggerUtils.js');
|
||||
const channelModel = require('../../../schemas/channelSchema.js');
|
||||
|
||||
//api account functions
|
||||
module.exports.get = async function(req, res){
|
||||
|
|
@ -25,7 +26,6 @@ module.exports.get = async function(req, res){
|
|||
res.status(200);
|
||||
return res.send(chanGuide);
|
||||
}catch(err){
|
||||
res.status(400);
|
||||
return res.send(err.message);
|
||||
return exceptionHandler(res, err);
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ You should have received a copy of the GNU Affero General Public License
|
|||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||
|
||||
//local imports
|
||||
const {exceptionHandler} = require('../../../utils/loggerUtils.js');
|
||||
const userModel = require('../../../schemas/userSchema');
|
||||
|
||||
//api account functions
|
||||
|
|
@ -25,7 +26,6 @@ module.exports.get = async function(req, res){
|
|||
res.status(200);
|
||||
return res.send(userList);
|
||||
}catch(err){
|
||||
res.status(400);
|
||||
return res.send(err.message);
|
||||
return exceptionHandler(res, err);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue