Crate bitwarden_uniffi_error

Source
Expand description

§Bitwarden UniFFI error

This crate provides some utilities to convert results inside uniffi::custom_type! calls, so that they don’t produce panics when there is a parsing error.

Structs§

Error
The Error type, a wrapper around a dynamic error type.

Statics§

ERROR_TO_UNIFFI_ERROR 🔒

Functions§

convert_error 🔒
convert_result
Convert a Result into one that will not cause a panic when called inside [uniffi::custom_type!]. It is required that all the results created inside a custom_type! are converted using this function.
set_error_to_uniffi_error
Configure an error converter to convert errors in calls to [uniffi::custom_type!] into the main error of the application (bitwarden_uniffi::error::BitwardenError). This is needed because if the errors don't match, Uniffi will panic instead of returning an error. This needs to be called by the bitwarden_uniffi` crate before any other Uniffi code is run.