Skip to content

Commit

Permalink
fix: runtime errors
Browse files Browse the repository at this point in the history
close #284, close #285
  • Loading branch information
klemens-morgenstern authored and vinniefalco committed Jun 12, 2023
1 parent ea602c2 commit 90668f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/Tool/ConfigImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ ConfigImpl(
namespace path = llvm::sys::path;

if(! files::isAbsolute(workingDir_))
throw Error("path \"{}\" is not absolute", workingDir_);
throw Error("working path \"{}\" is not absolute", workingDir_);
workingDir = files::makeDirsy(files::normalizePath(workingDir_));

if(auto err = files::requireDirectory(addonsDir_))
throw Error("path \"{}\" is not absolute", addonsDir_);
throw Error("addons path \"{}\" is not absolute", addonsDir_);
MRDOX_ASSERT(files::isDirsy(addonsDir_));
addonsDir = addonsDir_;

Expand Down
2 changes: 1 addition & 1 deletion source/Tool/ConfigImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ loadConfigString(
std::string_view addonsDir,
std::string_view configYaml)
{
return createConfigFromYAML(workingDir, configYaml, "");
return createConfigFromYAML(workingDir, addonsDir, configYaml);
}

} // mrdox
Expand Down
2 changes: 2 additions & 0 deletions source/Tool/TestAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ makeConfig(
std::error_code ec;
auto config = loadConfigString(
workingDir, toolArgs.addonsDir, configYaml);
if (!config)
reportError(config.getError(), "load the configuration string");
MRDOX_ASSERT(config);
return *config;
}
Expand Down

0 comments on commit 90668f3

Please sign in to comment.