Fixed !clear command to clear server-side chatBuffer as well as client buffers.
This commit is contained in:
parent
9eeed591ad
commit
de11803cea
3 changed files with 51 additions and 5 deletions
|
|
@ -176,8 +176,11 @@ module.exports.errorMiddleware = function(err, req, res, next){
|
|||
module.exports.dumpError = function(err, date = new Date()){
|
||||
try{
|
||||
const content = `Error Date: ${date.toLocaleString()} (UTC-${date.getTimezoneOffset()/60})\nError Type: ${err.name}\nError Msg:${err.message}\nStack Trace:\n\n${err.stack}`;
|
||||
const path = `log/crash/${date.getTime()}.log`;
|
||||
|
||||
fs.writeFile(`log/crash/${date.getTime()}.log`, content);
|
||||
fs.writeFile(path, content);
|
||||
|
||||
module.exports.consoleWarn(`Warning: Unexpected Server Crash gracefully dumped to '${path}'... SOMETHING MAY BE VERY BROKEN!!!!`);
|
||||
}catch(doubleErr){
|
||||
module.exports.consoleWarn("Yo Dawg, I herd you like errors, so I put an error in your error dump, so you can dump while you dump:");
|
||||
module.exports.consoleWarn(err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue