|
With the error handling API established with OGM-465 users can decide whether to continue or abort the current flush cycle upon a failed operation based on the type of the occurred exception.
In order to allow handlers being implemented in a more datastore-agnostic way, there should be means for translating dialect-specific exceptions into more generic OGM-defined exceptions. E.g. a MongoTimeoutException or a HTTP connection timeout exception in the case of CouchDB would be translated into a NoSqlTimeoutException. The error handler would receive that translated exception (with the original one as a cause) so it can do its decision in a more portable fashion.
Grid dialects would need the ability to contribute their implementation of an exception translator contract which would be invoked prior to passing on any exception raised by the dialect implementation.
|