diff options
author | Satya Rohith <me@satyarohith.com> | 2021-05-04 17:57:20 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-04 14:27:20 +0200 |
commit | 89b61b5d05b7441d42e4e88fe1180d9d3dc1727e (patch) | |
tree | 43afe9cca75060e7f5cece65317e7ad6c4217328 /cli/ops/runtime_compiler.rs | |
parent | 17118c41e4bf0cd8d9b78f72349c685d383b7291 (diff) |
fix(cli): give context when failed to load import map (#10478)
Diffstat (limited to 'cli/ops/runtime_compiler.rs')
-rw-r--r-- | cli/ops/runtime_compiler.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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) |