0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
denoland-deno/js/format_error.ts

10 lines
352 B
TypeScript
Raw Normal View History

// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
2019-08-26 08:50:21 -04:00
import * as dispatch from "./dispatch";
import { sendSync } from "./dispatch_json";
2019-08-26 08:50:21 -04:00
// TODO(bartlomieju): move to `repl.ts`?
export function formatError(errString: string): string {
2019-08-26 08:50:21 -04:00
const res = sendSync(dispatch.OP_FORMAT_ERROR, { error: errString });
return res.error;
}