summaryrefslogtreecommitdiff
path: root/js/console.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/console.ts')
-rw-r--r--js/console.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/console.ts b/js/console.ts
index 0797ab8e9..e5dafceee 100644
--- a/js/console.ts
+++ b/js/console.ts
@@ -3,6 +3,8 @@ import { isTypedArray } from "./util";
import { TextEncoder } from "./text_encoding";
import { File, stdout } from "./files";
import { cliTable } from "./console_table";
+import { formatError } from "./format_error";
+import { libdeno } from "./libdeno";
// tslint:disable-next-line:no-any
type ConsoleContext = Set<any>;
@@ -263,7 +265,8 @@ function createObjectString(
...args: [ConsoleContext, number, number]
): string {
if (value instanceof Error) {
- return value.stack! || "";
+ const errorJSON = libdeno.errorToJSON(value);
+ return formatError(errorJSON);
} else if (Array.isArray(value)) {
return createArrayString(value, ...args);
} else if (value instanceof Number) {