Centralized errors and added their translations. Didn't test
This commit is contained in:
@@ -2,23 +2,23 @@ import config from '../../config.json' with {type: "json"};
|
||||
|
||||
const debug = (text) => {
|
||||
if (config.debug) console.debug(`[D] [${Date()}]: ${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
const info = (text) => {
|
||||
console.log(`[I] [${Date()}]: ${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
const error = (text) => {
|
||||
console.error(`[E] [${Date()}]: ${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
const warn = (text) => {
|
||||
console.warn(`[W] [${Date()}]: ${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
const unknownError = (text) => {
|
||||
error(text);
|
||||
return "Unknown server error. Please, report to the developer";
|
||||
}
|
||||
};
|
||||
|
||||
export default { debug, info, error, warn, unknownError };
|
||||
Reference in New Issue
Block a user