summaryrefslogtreecommitdiff
path: root/src/lib/exceptions.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-05-01 19:32:15 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-01 19:32:15 +0200
commit1516214cdc7970797b79bca06b46a2eed16a1da3 (patch)
tree4d9d474fd498cf44c666219af240740527022ffc /src/lib/exceptions.h
parent8963f0007af1a312017b9627c18b82ec2a577591 (diff)
parent6f792158e88d9426a0eafc7f1724a33ddbd453e5 (diff)
Build with FFmpeg 4.4 and switch to the new send/receive APIs.
Diffstat (limited to 'src/lib/exceptions.h')
-rw-r--r--src/lib/exceptions.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h
index c64f561a8..5b7baf0e5 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 [%2", function, caller))
+ {}
+
+ explicit DecodeError (std::string function, std::string caller, int error)
+ : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, error))
+ {}
};
class CryptoError : public std::runtime_error
@@ -54,6 +62,7 @@ public:
{}
};
+
/** @class EncodeError
* @brief A low-level problem with an encoder.
*/
@@ -63,8 +72,17 @@ public:
explicit EncodeError (std::string s)
: std::runtime_error (s)
{}
+
+ explicit EncodeError (std::string function, std::string caller)
+ : std::runtime_error (String::compose("%1 failed [%2]", function, caller))
+ {}
+
+ explicit EncodeError (std::string function, std::string caller, int error)
+ : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, error))
+ {}
};
+
/** @class FileError.
* @brief Parent class for file-related errors.
*/