Finished up with email change backend. Just need to make a prompt on the profile page for our AJAX call.
This commit is contained in:
parent
4a865e8aa8
commit
a51152a89d
14 changed files with 444 additions and 13 deletions
|
|
@ -16,8 +16,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
|
||||
//At some point this will be a bit more advanced, right now it's just a placeholder :P
|
||||
module.exports.errorHandler = function(res, msg, type = "Generic", status = 400){
|
||||
res.status(status);
|
||||
return res.send({errors: [{type, msg, date: new Date()}]});
|
||||
//Some controllers do things after sending headers, for those, we should remain silent
|
||||
if(!res.headersSent){
|
||||
res.status(status);
|
||||
return res.send({errors: [{type, msg, date: new Date()}]});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.exceptionHandler = function(res, err){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue