From c7f881c86913f309f00f79289b2f3c88ce6919eb Mon Sep 17 00:00:00 2001
From: a1xd <68629610+a1xd@users.noreply.github.com>
Date: Tue, 11 Aug 2020 23:15:02 -0400
Subject: define exceptions for invalid arg & io errors
---
common/rawaccel.hpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'common/rawaccel.hpp')
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp
index 474f2aa..7aa1eb2 100644
--- a/common/rawaccel.hpp
+++ b/common/rawaccel.hpp
@@ -16,6 +16,8 @@
namespace rawaccel {
+ using milliseconds = double;
+
/// Struct to hold vector rotation details.
struct rotator {
@@ -104,8 +106,8 @@ namespace rawaccel {
vec2 clamp;
accel_function(const accel_fn_args& args) {
- if (args.time_min <= 0) error("min time must be positive");
- if (args.acc_args.offset < 0) error("offset must not be negative");
+ if (args.time_min <= 0) bad_arg("min time must be positive");
+ if (args.acc_args.offset < 0) bad_arg("offset must not be negative");
accel.tag = args.accel_mode;
accel.visit([&](auto& impl){ impl = { args.acc_args }; });
--
cgit v1.2.3