summaryrefslogtreecommitdiff
path: root/console/console.cpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-08-11 23:15:02 -0400
committera1xd <[email protected]>2020-08-11 23:15:02 -0400
commitc7f881c86913f309f00f79289b2f3c88ce6919eb (patch)
tree7ffc41237725e3ec0e9f53313644365912ded060 /console/console.cpp
parentadd a cooldown on write (one second) (diff)
downloadrawaccel-c7f881c86913f309f00f79289b2f3c88ce6919eb.tar.xz
rawaccel-c7f881c86913f309f00f79289b2f3c88ce6919eb.zip
define exceptions for invalid arg & io errors
Diffstat (limited to 'console/console.cpp')
-rw-r--r--console/console.cpp10
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';
}
}