mirror of
https://github.com/audacity/linuxdeploy.git
synced 2026-04-13 15:19:49 -05:00
Custom plugin base exception
Useful to differentiate between plugin and non-plugin exceptions.
This commit is contained in:
@@ -28,7 +28,7 @@ namespace linuxdeploy {
|
||||
public:
|
||||
explicit PrivateData(const boost::filesystem::path& path) : pluginPath(path) {
|
||||
if (!boost::filesystem::exists(path)) {
|
||||
throw std::runtime_error("No such file or directory: " + path.string());
|
||||
throw PluginError("No such file or directory: " + path.string());
|
||||
}
|
||||
|
||||
apiLevel = getApiLevelFromExecutable();
|
||||
|
||||
@@ -19,9 +19,17 @@ namespace linuxdeploy {
|
||||
/*
|
||||
* Exception class indicating that the plugin doesn't implement the right API level for the selected class
|
||||
*/
|
||||
class WrongApiLevelError : public std::runtime_error {
|
||||
class PluginError : public std::runtime_error {
|
||||
public:
|
||||
explicit WrongApiLevelError(const std::string& msg) : std::runtime_error(msg) {}
|
||||
explicit PluginError(const std::string& msg) : std::runtime_error(msg) {}
|
||||
};
|
||||
|
||||
/*
|
||||
* Exception class indicating that the plugin doesn't implement the right API level for the selected class
|
||||
*/
|
||||
class WrongApiLevelError : public PluginError {
|
||||
public:
|
||||
explicit WrongApiLevelError(const std::string& msg) : PluginError(msg) {}
|
||||
};
|
||||
|
||||
enum PLUGIN_TYPE {
|
||||
|
||||
Reference in New Issue
Block a user