Fixing error, when passing empty error

This commit is contained in:
Fabian Stamm
2018-09-17 22:42:22 +02:00
parent 95c93f22d0
commit 976f3cc95c
6 changed files with 15 additions and 12 deletions

View File

@ -125,6 +125,7 @@ export class LoggingBase {
}
error(error: Error | string) {
if (!error) error = "Empty ERROR was passed, so no informations available";
if (typeof error === "string") {
let e = new Error()
this.message(LoggingTypes.Error, [error, "\n", e.stack]);