Errors
All public SlateDB APIs return slatedb::Error. The part applications should treat as stable is Error::kind(), which returns ErrorKind. The formatted message and source chain are for logs and diagnosis; they can change between releases, so they are a poor place to hang recovery logic.
In practice, this means you should branch on the kind of failure, not on the exact text.
ErrorKind::Transactionmeans retry the whole transaction.ErrorKind::Unavailablemeans a dependency failed and the operation may succeed on retry.ErrorKind::Closedmeans the handle is done, andCloseReasonexplains why.ErrorKind::Invalid,ErrorKind::Data, andErrorKind::Internalusually mean you should stop and investigate instead of retrying blindly.
See the slatedb::ErrorKind rustdoc for a complete explanation of each kind.
Sources
Section titled “Sources”Error implements the standard source chain. This chain is useful for logs and for narrow diagnostics, such as checking whether a Data error came from an underlying object_store::Error::NotFound.