瀏覽代碼

Catch errors in import for bad keys

default_compile_flags
vector-of-bool 4 年之前
父節點
當前提交
e736f20917
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      src/dds/catalog/import.cpp

+ 5
- 1
src/dds/catalog/import.cpp 查看文件

@@ -41,7 +41,7 @@ auto reject_unknown_key(std::string_view path) {
return [path = std::string(path)](auto key, auto&&) { //
return reject(fmt::format("{}: unknown key '{}'", path, key));
};
};
}

std::vector<dependency> parse_deps_json_v1(const json5::data& deps, std::string_view path) {
std::vector<dependency> acc_deps;
@@ -140,6 +140,10 @@ package_info parse_pkg_json_v1(std::string_view name,
errc::invalid_catalog_json>("{}: Requires a remote listing (e.g. a 'git' proprety).",
path);
}
auto rej = std::get_if<semester::dc_reject_t>(&result);
if (rej) {
throw_user_error<errc::invalid_catalog_json>("{}: {}", path, rej->message);
}
return ret;
}


Loading…
取消
儲存