use web3_context for more errors

This commit is contained in:
Bryan Stitt 2023-06-18 16:40:17 -07:00
parent af8543c3bf
commit 89009dcd42
3 changed files with 7 additions and 4 deletions

View File

@ -134,7 +134,8 @@ pub async fn admin_increase_balance(
.to_owned(),
)
.exec(&db_conn)
.await?;
.await
.web3_context("admin is increasing balance")?;
let response = (StatusCode::OK, Json(out)).into_response();

View File

@ -1227,7 +1227,8 @@ impl Web3ProxyApp {
.to_owned(),
)
.exec(&db_conn)
.await?;
.await
.web3_context("creating empty balance row for existing user")?;
continue;
}

View File

@ -1,5 +1,5 @@
use crate::app::Web3ProxyApp;
use crate::errors::{Web3ProxyError, Web3ProxyResponse, Web3ProxyResult};
use crate::errors::{Web3ProxyError, Web3ProxyErrorContext, Web3ProxyResponse, Web3ProxyResult};
use crate::frontend::authorization::{
login_is_authorized, Authorization as Web3ProxyAuthorization,
};
@ -313,7 +313,8 @@ pub async fn user_balance_post(
.to_owned(),
)
.exec(&txn)
.await?;
.await
.web3_context("increasing balance")?;
trace!("Saving log {} of txid {:?}", log_index, tx_hash);
let receipt = increase_on_chain_balance_receipt::ActiveModel {