Skip to content
Open
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
16 changes: 8 additions & 8 deletions src/clients/macros.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[macro_export]
/// Make a GET request sending and expecting JSON.
/// if JSON deser fails, emit a `WARN` level tracing event
/// if JSON deser fails, emit a `ERROR` level tracing event
macro_rules! json_get {
($client:expr, $url:expr, $expected:ty, $exp_backoff:expr) => {
json_get!($client, $url, $expected, "", $exp_backoff)
Expand All @@ -27,7 +27,7 @@ macro_rules! json_get {
|error, duration: std::time::Duration| {
let duration = duration.as_secs();

tracing::warn!(
tracing::error!(
method = "GET",
url = %url,
?error,
Expand All @@ -38,7 +38,7 @@ macro_rules! json_get {
.await {
Ok(resp) => resp,
Err(error) => {
tracing::warn!(
tracing::error!(
method = "GET",
url = %url,
?error,
Expand All @@ -51,7 +51,7 @@ macro_rules! json_get {
} else {
match req.send().await {
Err(error) => {
tracing::warn!(
tracing::error!(
method = "GET",
url = %url,
?error,
Expand All @@ -75,7 +75,7 @@ macro_rules! json_get {

match result {
Err(e) => {
tracing::warn!(
tracing::error!(
method = "GET",
url = %url,
response = text.as_str(),
Expand All @@ -93,7 +93,7 @@ macro_rules! json_get {

#[macro_export]
/// Make a PUT request sending JSON.
/// if JSON deser fails, emit a `WARN` level tracing event
/// if JSON deser fails, emit a `ERROR` level tracing event
macro_rules! json_put {
($client:expr, $url:expr, $auth_token:expr, $body:expr) => {
json_put!($client, $url, (), $auth_token, $body)
Expand All @@ -112,7 +112,7 @@ macro_rules! json_put {
.send()
.await {
Err(error) => {
tracing::warn!(
tracing::error!(
method = "PUT",
url = %url,
body = body,
Expand All @@ -129,7 +129,7 @@ macro_rules! json_put {
let result: $crate::clients::common::ClientResponse<$expected> = text.parse()?;

if result.is_err() {
tracing::warn!(
tracing::error!(
method = "PUT",
url = %url,
body,
Expand Down
Loading