mirror of
https://git.bits.team/Bits/mod-manager.git
synced 2025-06-30 17:19:43 -04:00
Added an error parameter to PrintUtils#error to allow logging of an accompany Error obj
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import chalk from "chalk";
|
||||
import ora, {Ora} from "ora";
|
||||
import ModManager from "../mod-manager.js";
|
||||
|
||||
export default class PrintUtils {
|
||||
|
||||
@ -51,7 +52,13 @@ export default class PrintUtils {
|
||||
console.log(chalk.greenBright(print));
|
||||
}
|
||||
|
||||
static error(print: string) {
|
||||
static error(print: string, err?: Error) {
|
||||
console.log(chalk.redBright(print));
|
||||
|
||||
if (err instanceof Error) {
|
||||
if (ModManager.logger != null) {
|
||||
ModManager.logger.error(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user