diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-28 10:50:08 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-05-01 01:31:57 +0200 |
| commit | e5ae44fe8287c6a5f91c8f9dfced7cb661f0d79b (patch) | |
| tree | 3afa2bdf2c7c6e9b471d016e4b99ae0274d92ccc /src/lib/exceptions.h | |
| parent | c93d0271dad86dccdbe518dbbe6e2175adce6804 (diff) | |
Tidy up some error handling a little.
Diffstat (limited to 'src/lib/exceptions.h')
| -rw-r--r-- | src/lib/exceptions.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index c64f561a8..8bce0c8ab 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -44,6 +44,14 @@ public: explicit DecodeError (std::string s) : std::runtime_error (s) {} + + explicit DecodeError (std::string function, std::string caller) + : std::runtime_error (String::compose("%1 failed in %2", function, caller)) + {} + + explicit DecodeError (std::string function, std::string caller, int error) + : std::runtime_error (String::compose("%1 failed in %2 (%3)", function, caller, error)) + {} }; class CryptoError : public std::runtime_error |
