From 89b61b5d05b7441d42e4e88fe1180d9d3dc1727e Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Tue, 4 May 2021 17:57:20 +0530 Subject: fix(cli): give context when failed to load import map (#10478) --- cli/ops/runtime_compiler.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cli/ops/runtime_compiler.rs') diff --git a/cli/ops/runtime_compiler.rs b/cli/ops/runtime_compiler.rs index 4865c1045..8e3ca80b5 100644 --- a/cli/ops/runtime_compiler.rs +++ b/cli/ops/runtime_compiler.rs @@ -87,7 +87,13 @@ async fn op_emit( let file = program_state .file_fetcher .fetch(&import_map_specifier, &mut runtime_permissions) - .await?; + .await + .map_err(|e| { + generic_error(format!( + "Unable to load '{}' import map: {}", + import_map_specifier, e + )) + })?; ImportMap::from_json(import_map_specifier.as_str(), &file.source)? }; Some(import_map) -- cgit v1.2.3