Started work on site-wide toke command management & errorHandler
This commit is contained in:
parent
d516fed309
commit
af7f4219a5
12 changed files with 146 additions and 11 deletions
|
|
@ -15,10 +15,15 @@ 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/>.*/
|
||||
|
||||
//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"){
|
||||
res.status(400);
|
||||
return res.send({errors: [{type, msg, date: new Date()}]});
|
||||
}
|
||||
|
||||
module.exports.exceptionHandler = function(res, err){
|
||||
//if not yell at the browser for fucking up, and tell it what it did wrong.
|
||||
res.status(400);
|
||||
return res.send({errors: [{type: "Caught Exception", msg: err.message, date: new Date()}]});
|
||||
module.exports.errorHandler(res, err.message, "Caught Exception");
|
||||
}
|
||||
|
||||
module.exports.socketExceptionHandler = function(socket, err){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue