aboutsummaryrefslogtreecommitdiffhomepage
path: root/hyprpm/src
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-07-30 11:54:28 +0200
committerVaxry <[email protected]>2024-07-30 11:54:28 +0200
commit743e98f0c0c2de63a0715f7112dade3a819a8307 (patch)
treede6d4daefacfb74bb881d4768f655357bb13e393 /hyprpm/src
parente67322034037fef22079c8e480be38c1d04b5a4a (diff)
downloadHyprland-743e98f0c0c2de63a0715f7112dade3a819a8307.tar.gz
Hyprland-743e98f0c0c2de63a0715f7112dade3a819a8307.zip
hyprpm: add short error code explanations
Diffstat (limited to 'hyprpm/src')
-rw-r--r--hyprpm/src/core/PluginManager.cpp15
-rw-r--r--hyprpm/src/core/PluginManager.hpp1
2 files changed, 15 insertions, 1 deletions
diff --git a/hyprpm/src/core/PluginManager.cpp b/hyprpm/src/core/PluginManager.cpp
index edb98812..15ce87f7 100644
--- a/hyprpm/src/core/PluginManager.cpp
+++ b/hyprpm/src/core/PluginManager.cpp
@@ -529,7 +529,8 @@ bool CPluginManager::updateHeaders(bool force) {
std::cout << "\n";
} else {
- progress.printMessageAbove(std::string{Colors::RED} + "✖" + Colors::RESET + " failed to install headers with error code " + std::to_string((int)HEADERSVALID));
+ progress.printMessageAbove(std::string{Colors::RED} + "✖" + Colors::RESET + " failed to install headers with error code " + std::to_string((int)HEADERSVALID) + " (" +
+ headerErrorShort(HEADERSVALID) + ")");
progress.m_iSteps = 5;
progress.m_szCurrentMessage = "Failed";
progress.print();
@@ -880,6 +881,18 @@ std::string CPluginManager::headerError(const eHeadersErrors err) {
return std::string{Colors::RED} + "✖" + Colors::RESET + " Unknown header error. Please run hyprpm update to fix those.\n";
}
+std::string CPluginManager::headerErrorShort(const eHeadersErrors err) {
+ switch (err) {
+ case HEADERS_CORRUPTED: return "Headers corrupted";
+ case HEADERS_MISMATCHED: return "Headers version mismatched";
+ case HEADERS_NOT_HYPRLAND: return "Not running on Hyprland";
+ case HEADERS_MISSING: return "Headers missing";
+ case HEADERS_DUPLICATED: return "Headers duplicated";
+ default: break;
+ }
+ return "?";
+}
+
bool CPluginManager::hasDeps() {
std::vector<std::string> deps = {"meson", "cpio", "cmake"};
for (auto& d : deps) {
diff --git a/hyprpm/src/core/PluginManager.hpp b/hyprpm/src/core/PluginManager.hpp
index 13ea5b12..c16a9d0f 100644
--- a/hyprpm/src/core/PluginManager.hpp
+++ b/hyprpm/src/core/PluginManager.hpp
@@ -66,6 +66,7 @@ class CPluginManager {
private:
std::string headerError(const eHeadersErrors err);
+ std::string headerErrorShort(const eHeadersErrors err);
std::string m_szWorkingPluginDirectory = "";
};