Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Handle failures and exceptions #148

Open
TanmayPatil105 opened this issue May 12, 2024 · 0 comments
Open

Handle failures and exceptions #148

TanmayPatil105 opened this issue May 12, 2024 · 0 comments

Comments

@TanmayPatil105
Copy link
Owner

Currently, the program doesn't handle exceptions and it halts. I'm listing some failures here that I have experienced.

1. Username

string getuser()
{   
    return getenv("USER");
}

See discussion on #145!

2. Theme

string getTheme()
{   
    auto args = "gsettings get org.gnome.desktop.interface gtk-theme"s;
    auto s = Command::exec(args)->getOutput();
    return s.substr(1, s.find("\'", 1) - 1);
}   

Some machines don't have it installed. For example, Docker containers.

3. Icons

string getIcons()
{
    auto args = "gsettings get org.gnome.desktop.interface icon-theme"s;
    auto s = Command::exec(args)->getOutput();
    return s.substr(1, s.find("\'", 1) - 1);
}

Same as above

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant