Skip to content

Commit e0ae00c

Browse files
committed
Include full RPC error messages in HTTP replies
Using the `From<errors::Error> for HttpError` conversion, which uses the full Error `Display` instead of just its `description()`. Resolves #132.
1 parent 680eaca commit e0ae00c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/rest.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -987,9 +987,7 @@ fn handle_request(
987987
.ok_or_else(|| HttpError::from("Missing tx".to_string()))?,
988988
_ => return http_message(StatusCode::METHOD_NOT_ALLOWED, "Invalid method", 0),
989989
};
990-
let txid = query
991-
.broadcast_raw(&txhex)
992-
.map_err(|err| HttpError::from(err.description().to_string()))?;
990+
let txid = query.broadcast_raw(&txhex)?;
993991
http_message(StatusCode::OK, txid.to_string(), 0)
994992
}
995993

0 commit comments

Comments
 (0)