packageNotFound property

PackageNotFoundException? packageNotFound

Returns a PackageNotFoundException that (transitively) caused this failure, or null if it wasn't caused by a PackageNotFoundException.

If multiple PackageNotFoundExceptions caused the error, it's undefined which one is returned.

Implementation

PackageNotFoundException? get packageNotFound {
  for (var incompatibility in incompatibility.externalIncompatibilities) {
    var cause = incompatibility.cause;
    if (cause is PackageNotFoundIncompatibilityCause) return cause.exception;
  }
  return null;
}