tiledb-rs
error styling part 1: Context::capi_call
returns its own error type
#191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In
tiledb-tables
, we've begun to declare at least oneError
enum per module. If a modulefoo
calls a function from a modulebar
, thenfoo::Error
has an enum variant approximatingBar(bar::Error)
. This can help build a causality chain in error output.We have discussed bringing this error style into
tiledb-rs
, and this pull request is a foray into doing so. We begin with the core oftiledb-rs
,Context::capi_call
. This pull request addsCApiError
which is returned byContext::capi_call
. The rest of the changes fell out of that in some way.There are a few
// SAFETY
comments for newunwrap
s. These are added in situations where we try to convert a value returned from tiledb into one of thetiledb-rs
enums. The presupposition is that if libtiledb returnedTILEDB_OK
then it must have given a valid enum value. I am personally comfortable with this assumption (I believe I am aligned with this blog aboutunwrap
) but I'm also fine changing it if requested - it would nudge the code in the direction of moreError
variants.