libmongoc 1.4 introduced a new error API (MONGOC_ERROR_API_VERSION_2), which allows applications to reliably distinguish error codes originating from the client/driver and server. The differences and benefits of this new API are discussed here.
Current hierarchy
- RuntimeException
- ConnectionException
- AuthenticationException
- ConnectionTimeoutException
- SSLConnectionException
- ExecutionTimeoutException
- WriteException
- BulkWriteException
- ConnectionException
Proposed hierarchy
- RuntimeException
- ConnectionException
- AuthenticationException
- ConnectionTimeoutException
- SSLConnectionException (deprecated)
- ServerException
- CommandException
- ExecutionTimeoutException
- WriteException
- BulkWriteException
- ConnectionException