mirror of
https://github.com/denoland/deno.git
synced 2024-10-30 09:08:00 -04:00
c9614d86c1
Fixes some sed errors introduced in c43cfe. Unfortunately moving libdeno required splitting build.rs into two parts, one for cli and one for core. I've also removed the arm64 build - it's complicating things at this re-org and we're not even testing it. I need to swing back to it and get tools/test.py running for it.
21 lines
920 B
TypeScript
21 lines
920 B
TypeScript
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
|
import * as msg from "gen/cli/msg_generated";
|
|
import * as flatbuffers from "./flatbuffers";
|
|
import { sendSync } from "./dispatch";
|
|
import { assert } from "./util";
|
|
|
|
export function formatError(errString: string): string {
|
|
const builder = flatbuffers.createBuilder();
|
|
const errString_ = builder.createString(errString);
|
|
msg.FormatError.startFormatError(builder);
|
|
msg.FormatError.addError(builder, errString_);
|
|
const offset = msg.FormatError.endFormatError(builder);
|
|
const baseRes = sendSync(builder, msg.Any.FormatError, offset);
|
|
assert(baseRes != null);
|
|
assert(msg.Any.FormatErrorRes === baseRes!.innerType());
|
|
const formatErrorResMsg = new msg.FormatErrorRes();
|
|
assert(baseRes!.inner(formatErrorResMsg) != null);
|
|
const formattedError = formatErrorResMsg.error();
|
|
assert(formatError != null);
|
|
return formattedError!;
|
|
}
|