Skip to content

Commit 00715d3

Browse files
koivunejKristianWahlroos
authored andcommitted
fix(spsp_routes): apply formatting suggestions
Signed-off-by: Kristian Wahlroos <kristian.whl@gmail.com>
1 parent 6cea819 commit 00715d3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/interledger-api/src/routes/accounts.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,28 +454,28 @@ where
454454
.and(warp::path::end())
455455
.and(with_store.clone())
456456
.and_then(move |id: Uuid, tracking_info: String, store: S| {
457-
trace!("Tracking info: {:?}", tracking_info);
458457

459458
let server_secret_clone = server_secret_clone.clone();
460459
async move {
461460
let accounts = store.get_accounts(vec![id]).await?;
462461
// TODO return the response without instantiating an SpspResponder (use a simple fn)
463462

464-
match Address::from_str(&format!("{}.{}", accounts[0].ilp_address(), tracking_info))
463+
let combined = format!("{}.{}", accounts[0].ilp_address(), tracking_info);
464+
match Address::from_str(&combined)
465465
{
466466
Ok(addr) => {
467467
trace!(
468-
"merged: {}",
469-
format!("{}.{}", accounts[0].ilp_address(), tracking_info)
468+
account_id=%id,
469+
"Appended tracking info: {}",
470+
addr,
470471
);
471472
Ok::<_, Rejection>(
472473
SpspResponder::new(addr, server_secret_clone.clone())
473474
.generate_http_response(),
474475
)
475476
}
476477
Err(err) => {
477-
let msg = format!("Error sending SPSP payment: {}", err);
478-
error!("{}", msg);
478+
error!(?combined, "Appending tracking information produced an invalid address: {}", err);
479479
// TODO give a different error message depending on what type of error it is
480480
Err(Rejection::from(
481481
ApiError::internal_server_error().detail(msg),

0 commit comments

Comments
 (0)