Defined in <dso/DSOExceptions.hh> (which includes <Exception.hh>). Link dsold.
Both types derive from Exception, the toolkit's base exception, which provides whatStr() (and, through the standard hierarchy, what()).
FileNotFound
class FileNotFound : public Exception
{
public:
FileNotFound( std::string const& filename, std::string const& reason ) noexcept;
FileNotFound( std::string const& filename, std::string const& reason,
std::locale const& loc ) noexcept;
std::string whatStr() const noexcept override;
std::string missingFilename() const; // the name that failed
std::string reason() const; // the dlerror() text
};
Thrown by:
DSOLoader::load—dlopenfailed, or no directory in the search list yielded a loadable file.DSOLoader::loadAll/loadAllByEnvironment— one or more files in the directory failed to load (thrown after the others are loaded), naming the failures.DSOLoader::loadSigned/loadVerified— the DSO could not be found or loaded at all.
try {
DSOLoader::loadAll( ".so", pluginDir );
} catch( fedem::exception::FileNotFound const& e ) {
std::clog << "some plugins failed: " << e.missingFilename()
<< " — " << e.reason() << '\n';
}
SignatureRejected
class SignatureRejected : public Exception
{
public:
SignatureRejected( std::string const& soPath, std::string const& reason ) noexcept;
std::string whatStr() const noexcept override; // "DSO signature check failed for \"...\": ..."
std::string const& soPath() const noexcept;
std::string const& reason() const noexcept;
};
Thrown by DSOLoader::loadVerified when the DSO's TrustLevel is below the requested minTrust (so: REJECTED, UNSIGNED, or UNKNOWN, depending on the floor). loadSigned never throws this — it reports the level in its result instead.
Only present when dsold is built with plugin-sign.
try {
DSOLoader::loadVerified( "libCircle.so", dirs, keysDir,
fedem::sign::TrustLevel::TRUSTED );
} catch( fedem::exception::SignatureRejected const& e ) {
fatal( "untrusted plugin " + e.soPath() + ": " + e.reason() );
}
Notes
- Catch
fedem::exception::Exception const&to handle both (and any other library exception) in one clause; catch the leaf types when you needmissingFilename()/soPath(). PluginCatalog/Plugin::createdo not throw these — an unknown key is anullptrreturn. They can propagatestd::runtime_error/std::bad_any_castfrom the config path (see Creator).

