diff --git a/source/dub/commandline.d b/source/dub/commandline.d index 56ebb8f94..32a110eb6 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -2176,8 +2176,7 @@ class FetchCommand : FetchRemoveCommand { } catch(Exception e){ logInfo("Getting a release version failed: %s", e.msg); - logInfo("Retry with ~master..."); - dub.fetch(name, VersionRange.fromString("~master"), location, fetchOpts); + return 1; } } return 0; diff --git a/source/dub/dub.d b/source/dub/dub.d index 51d75c954..19c97e119 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -913,7 +913,8 @@ class Dub { logDebug("Full error: %s", e.toString().sanitize()); } } - enforce(pinfo.type != Json.Type.undefined, "No package "~packageId~" was found matching the dependency " ~ range.toString()); + enforce(!pinfo.type.among(Json.Type.undefined, Json.Type.null_), + "No package " ~ packageId ~ " was found matching the dependency " ~ range.toString()); Version ver = Version(pinfo["version"].get!string); // always upgrade branch based versions - TODO: actually check if there is a new commit available