Skip to content

Commit

Permalink
Improve error messages when a package does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed May 4, 2020
1 parent 92e138a commit abe7693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion OMCompiler/Compiler/Script/CevalScriptBackend.mo
Expand Up @@ -2371,7 +2371,10 @@ algorithm
case (cache,_,"installPackage",{Values.CODE(Absyn.C_TYPENAME(path as Absyn.QUALIFIED())), _, _},_)
algorithm
Error.addMessage(Error.ERROR_PKG_NOT_IDENT, {AbsynUtil.pathString(path)});
then fail();
then (cache, Values.BOOL(false));

case (cache,_,"installPackage",_,_)
then (cache, Values.BOOL(false));

case (cache,_,"updatePackageIndex",{},_)
algorithm
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/Script/PackageManagement.mo
Expand Up @@ -429,7 +429,7 @@ algorithm
// We know which version we want now. Check with the installed ones
installedLibraries := getInstalledLibraries();

if exactMatch and listEmpty(candidates) then
if listEmpty(candidates) then
versionToInstall := version;
semverToInstall := semver;
elseif exactMatch and not listEmpty(exactMatches) then
Expand Down

0 comments on commit abe7693

Please sign in to comment.