8 #define UNWRAP_ERROR_CODE(ec) \ 18 case E::FAILED_TO_CREATE_DIR:
19 return "Failed to create directory";
21 return "File already exists, but it's not a directory";
23 return "Unknown application::util error";
32 boost::system::error_code ec{};
33 if (not fs::exists(path, ec)) {
35 if (not fs::create_directory(path, ec)) {
40 if (not fs::is_directory(path, ec)) {
45 return outcome::success();
#define UNWRAP_ERROR_CODE(ec)
OUTCOME_CPP_DEFINE_CATEGORY(kagome::application::util, Error, e)
outcome::result< void > init_directory(const boost::filesystem::path &path)