mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(node): revert invalid package target change (#24539)
Reason is that `e` may contain an invalid package target nested deeply in the returned errors. We should probably add a `.code()` to all errors to make matching easier or make the errors flatter.
This commit is contained in:
parent
3d0e1b65b1
commit
1200f69082
1 changed files with 5 additions and 5 deletions
|
@ -878,15 +878,15 @@ impl NodeResolver {
|
||||||
last_error = None;
|
last_error = None;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Err(e) => match e.as_kind() {
|
Err(e) => {
|
||||||
PackageTargetResolveErrorKind::InvalidPackageTarget(_) => {
|
// todo(dsherret): add codes to each error and match on that instead
|
||||||
|
if e.to_string().starts_with("[ERR_INVALID_PACKAGE_TARGET]") {
|
||||||
last_error = Some(e);
|
last_error = Some(e);
|
||||||
continue;
|
continue;
|
||||||
}
|
} else {
|
||||||
_ => {
|
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if last_error.is_none() {
|
if last_error.is_none() {
|
||||||
|
|
Loading…
Reference in a new issue