From ea6179f7dce89416f1586ee18c2f437e68eabd38 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Fri, 7 Feb 2020 17:54:05 +1100 Subject: Improve support for diagnostics from runtime compiler APIs (#3911) - Exports diagnostic items from `diagnostics.ts` which are missing at runtime. - Returns an array of diagnostics, instead of an object with a property of `items`. This is because of the way Rust deals with certain structures, and shouldn't be exposed in the APIs. --- cli/js/compiler_sourcefile.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cli/js/compiler_sourcefile.ts') diff --git a/cli/js/compiler_sourcefile.ts b/cli/js/compiler_sourcefile.ts index 8e81cdb45..c0a301786 100644 --- a/cli/js/compiler_sourcefile.ts +++ b/cli/js/compiler_sourcefile.ts @@ -44,7 +44,9 @@ function getExtension(fileName: string, mediaType: MediaType): ts.Extension { return ts.Extension.Js; case MediaType.Unknown: default: - throw TypeError("Cannot resolve extension."); + throw TypeError( + `Cannot resolve extension for "${fileName}" with mediaType "${MediaType[mediaType]}".` + ); } } -- cgit v1.2.3