From f530189c500b9f12c4c94e88eca23eab9ae0d970 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 9 Dec 2021 20:24:37 -0500 Subject: fix(watch): mitigate race condition between file write by other process and watch read (#13038) --- cli/ops/runtime_compiler.rs | 4 +++- 1 file changed, 3 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 d79a5fe31..af99f12ca 100644 --- a/cli/ops/runtime_compiler.rs +++ b/cli/ops/runtime_compiler.rs @@ -166,7 +166,9 @@ async fn op_emit( args.import_map_path { let import_map_specifier = resolve_url_or_path(&import_map_str) - .context(format!("Bad URL (\"{}\") for import map.", import_map_str))?; + .with_context(|| { + format!("Bad URL (\"{}\") for import map.", import_map_str) + })?; let import_map = if let Some(value) = args.import_map { ImportMap::from_json(import_map_specifier.as_str(), &value.to_string())? } else { -- cgit v1.2.3