summaryrefslogtreecommitdiff
path: root/cli/js/format_error.ts
blob: 801da0d0b9a40b29a25ec39eae310ed1e878122b (plain)
1
2
3
4
5
6
7
8
9
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import * as dispatch from "./dispatch.ts";
import { sendSync } from "./dispatch_json.ts";

// TODO(bartlomieju): move to `repl.ts`?
export function formatError(errString: string): string {
  const res = sendSync(dispatch.OP_FORMAT_ERROR, { error: errString });
  return res.error;
}