serializable structured errors

This commit is contained in:
Joseph Montanaro committed 2022-12-29 16:40:48 -08:00
1 parent cb26201506
commit e0c4c849dc
4 files changed
+174 -54

No files matched your search

+4 -8
View File
@@ -36,10 +36,8 @@ pub fn respond(response: RequestResponse, app_state: State<'_, AppState>) -> Res
#[tauri::command]
pub async fn unlock(passphrase: String, app_state: State<'_, AppState>) -> Result<(), SerializeError<UnlockError>> {
app_state.decrypt(&passphrase)
.await
.map_err(|e| SerializeError::from(e))
pub async fn unlock(passphrase: String, app_state: State<'_, AppState>) -> Result<(), UnlockError> {
app_state.decrypt(&passphrase).await
}
@@ -59,10 +57,8 @@ pub async fn save_credentials(
credentials: Credentials,
passphrase: String,
app_state: State<'_, AppState>
) -> Result<(), SerializeError<UnlockError>> {
app_state.save_creds(credentials, &passphrase)
.await
.map_err(|e| SerializeError::from(e))
) -> Result<(), UnlockError> {
app_state.save_creds(credentials, &passphrase).await
}