diff --git a/include/antler/project/net_utils.hpp b/include/antler/project/net_utils.hpp index f53a5b3..9e17c2a 100644 --- a/include/antler/project/net_utils.hpp +++ b/include/antler/project/net_utils.hpp @@ -100,11 +100,15 @@ namespace antler::project { } } - std::string request(std::string_view org, std::string_view repo) { + std::string build_github_url(std::string_view org, std::string_view repo) { std::string url = "https://api.github.com/repos/"; url += std::string(org) + std::string("/"); url += repo; - auto s = sender.authenticated_request(bearer_token, url.c_str()); + return url; + } + + std::string request(std::string_view org, std::string_view repo) { + auto s = sender.authenticated_request(bearer_token, build_github_url(org, repo).c_str()); return s; } @@ -122,10 +126,13 @@ namespace antler::project { auto js = nlohmann::json::parse(request(s)); auto msg = js["message"]; if (!msg.is_null()) - if (msg == "Not Found") + if (msg == "Not Found") { + system::error_log("Cannot find github repo using URL: {0}", build_github_url(get_org(s), get_repo(s))); return false; + } return true; } catch(...) { + system::error_log("Unknown error when requesting URL: {0}", build_github_url(get_org(s), get_repo(s))); return false; } } diff --git a/src/location.cpp b/src/location.cpp index 03ae4a3..9a3f7a6 100644 --- a/src/location.cpp +++ b/src/location.cpp @@ -34,7 +34,7 @@ bool is_github_repo(std::string_view s) { return is_github(s) && !is_archive(s); bool is_reachable(std::string_view l) { if (!is_github_shorthand(l)) { - system::error_log("In this version of antler-proj only github shorthands are supported. Generalized git repos and archives will be supported in a future version."); + system::error_log("In this version of antler-proj only github shorthands (i.e. org/project) are supported. Generalized git repos and archives will be supported in a future version."); return false; } diff --git a/src/project.cpp b/src/project.cpp index efb28e6..5c1e410 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -118,7 +118,7 @@ bool project::validate_dependency(const dependency& dep) const noexcept { if (dep.location().empty()) { return lib_exists(dep.name()); } else if (!dep.is_valid_location()) { - system::error_log("Error denpendency: {0} is invalid.", dep.name()); + system::error_log("Error dependency: {0} is invalid.", dep.name()); return false; } return true;