Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example: Async error catching issue #25

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions crates/bitwarden-wasm-internal/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,18 @@
env!("SDK_VERSION").to_owned()
}

pub fn throw(&self, msg: String) -> Result<(), crate::error::GenericError> {
Err(crate::error::GenericError(msg))
pub fn echo_complex(
&self,
args: bitwarden_core::mobile::crypto::InitUserCryptoRequest,
) -> Result<String, crate::error::GenericError> {
Ok(args.email)
}

Check warning on line 61 in crates/bitwarden-wasm-internal/src/client.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm-internal/src/client.rs#L56-L61

Added lines #L56 - L61 were not covered by tests

pub async fn echo_complex_async(
&self,
args: bitwarden_core::mobile::crypto::InitUserCryptoRequest,
) -> Result<String, crate::error::GenericError> {
Ok(args.email)

Check warning on line 67 in crates/bitwarden-wasm-internal/src/client.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm-internal/src/client.rs#L63-L67

Added lines #L63 - L67 were not covered by tests
}

/// Test method, calls http endpoint
Expand Down