diff options
| author | a1xd <[email protected]> | 2020-08-11 23:15:02 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2020-08-11 23:15:02 -0400 |
| commit | c7f881c86913f309f00f79289b2f3c88ce6919eb (patch) | |
| tree | 7ffc41237725e3ec0e9f53313644365912ded060 /console/console.cpp | |
| parent | add a cooldown on write (one second) (diff) | |
| download | rawaccel-c7f881c86913f309f00f79289b2f3c88ce6919eb.tar.xz rawaccel-c7f881c86913f309f00f79289b2f3c88ce6919eb.zip | |
define exceptions for invalid arg & io errors
Diffstat (limited to 'console/console.cpp')
| -rw-r--r-- | console/console.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/console/console.cpp b/console/console.cpp index 9a1d66f..f86dfc2 100644 --- a/console/console.cpp +++ b/console/console.cpp @@ -10,12 +10,10 @@ int main(int argc, char** argv) { try { ra::write(ra::parse(argc, argv)); } - catch (std::domain_error e) { - std::cerr << e.what() << '\n'; - return ra::INVALID_ARGUMENT; + catch (const std::system_error& e) { + std::cerr << e.what() << " (" << e.code() << ")\n"; } - catch (std::system_error e) { - std::cerr << "Error: " << e.what() << " (" << e.code() << ")\n"; - return ra::SYSTEM_ERROR; + catch (const std::exception& e) { + std::cerr << e.what() << '\n'; } } |