Skip to content

Commit 6303db3

Browse files
committed
Use proper errors in Uniffi
1 parent 03d02e6 commit 6303db3

File tree

53 files changed

+538
-435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+538
-435
lines changed

Cargo.lock

Lines changed: 121 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ tokio = { version = "1.36.0", features = ["macros"] }
7575
tsify = { version = ">=0.5.5, <0.6", features = [
7676
"js",
7777
], default-features = false }
78-
uniffi = "=0.29.1"
78+
uniffi = "=0.29.4"
7979
uuid = { version = ">=1.3.3, <2.0", features = ["serde", "v4", "js"] }
8080
validator = { version = ">=0.18.1, <0.21", features = ["derive"] }
8181
wasm-bindgen = { version = ">=0.2.91, <0.3", features = ["serde-serialize"] }
@@ -89,6 +89,13 @@ wiremock = ">=0.6.0, <0.7"
8989
[patch.crates-io]
9090
pkcs5 = { git = "https://github.com/bitwarden/rustcrypto-formats.git", rev = "2b27c63034217dd126bbf5ed874da51b84f8c705" }
9191

92+
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "c3a2127332d18ba9dbde1e23778b3af8f355cbac" }
93+
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "c3a2127332d18ba9dbde1e23778b3af8f355cbac" }
94+
uniffi_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "c3a2127332d18ba9dbde1e23778b3af8f355cbac" }
95+
uniffi_internal_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "c3a2127332d18ba9dbde1e23778b3af8f355cbac" }
96+
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs", rev = "c3a2127332d18ba9dbde1e23778b3af8f355cbac" }
97+
uniffi_build = { git = "https://github.com/mozilla/uniffi-rs", rev = "c3a2127332d18ba9dbde1e23778b3af8f355cbac" }
98+
9299
[workspace.lints.clippy]
93100
unused_async = "deny"
94101
unwrap_used = "deny"

crates/bitwarden-collections/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ pub enum CollectionsParseError {
1515
#[error(transparent)]
1616
Crypto(#[from] bitwarden_crypto::CryptoError),
1717
#[error(transparent)]
18-
MissingFieldError(#[from] bitwarden_core::MissingFieldError),
18+
MissingField(#[from] bitwarden_core::MissingFieldError),
1919
}

crates/bitwarden-core/src/auth/auth_client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ impl AuthClient {
206206
#[allow(missing_docs)]
207207
#[cfg(feature = "internal")]
208208
#[derive(Debug, thiserror::Error)]
209+
#[cfg_attr(feature = "uniffi", derive(uniffi::Error), uniffi(flat_error))]
209210
pub enum TrustDeviceError {
210211
#[error(transparent)]
211212
VaultLocked(#[from] crate::VaultLockedError),

crates/bitwarden-core/src/auth/auth_request.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub(crate) fn auth_request_decrypt_master_key(
7575

7676
#[allow(missing_docs)]
7777
#[derive(Debug, Error)]
78+
#[cfg_attr(feature = "uniffi", derive(uniffi::Error), uniffi(flat_error))]
7879
pub enum ApproveAuthRequestError {
7980
#[error(transparent)]
8081
Crypto(#[from] CryptoError),

0 commit comments

Comments
 (0)