Soprano
2.9.0
|
Soprano tries to simulate exceptions through the usage of Soprano::Error::ErrorCache.
Most methods in Soprano classes have a means of reporting if an operation was successful or not. For additional error information they inherit Soprano::Error::ErrorCache which provides the method Soprano::Error::ErrorCache::lastError().
Thus, advanced error handling would look as follows:
For methods that do not return an immediate error status, Soprano::Error::Error evaluates to a boolean. Thus, one can easily check if an error occurred as follows:
This has the same effect as checking for Soprano::Error::ErrorNone.
This error handling is thread-safe. Thus, two threads can for example call methods of one Model at the same time and still get proper Soprano::Error::Error instances back.