mirror of
https://github.com/hyprwm/hyprlang.git
synced 2025-05-12 21:30:37 +01:00
style: add references for catching exceptions
This commit is contained in:
parent
1e6b7152c1
commit
0be046c849
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
#include "config.hpp"
|
||||
#include <exception>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
|
@ -167,7 +168,7 @@ static std::expected<int64_t, std::string> configStringToInt(const std::string&
|
|||
auto result = stoll(value, &position, 16);
|
||||
if (position == value.size())
|
||||
return result;
|
||||
} catch (std::out_of_range) { return std::unexpected("hex " + value + " is too big"); } catch (...) {
|
||||
} catch (const std::out_of_range&) { return std::unexpected("hex " + value + " is too big"); } catch (const std::exception&) {
|
||||
}
|
||||
return std::unexpected("invalid hex " + value);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue