summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh McKinney <joshka@users.noreply.github.com>2023-04-12 19:41:48 -0700
committerD. Scott Boggs <scott@tams.tech>2023-09-01 07:51:59 -0400
commit9fd2262d3a9044389f8a6e12fcdfbc1dfd510d3b (patch)
tree8446711de77e31446b627c173d7c51050ac3202c
parent4622f3652decbd28f127897470180542ae5a3590 (diff)
fix: error message for page_next/prev now shows actual method
This error message showed $method instead of next_page/prev_page. (wrapping added for readability) ERROR mastodon_async::page: error making API request err=reqwest::Error { kind: Status(401), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("mastodon.social")), port: None, path: "/api/v1/timelines/home", query: Some("max_id=109299574068567249"), fragment: None } } url="<snip>" method="$method" <<<<<< should be next_page/prev_page call_id=<snip>
-rw-r--r--src/page.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/page.rs b/src/page.rs
index ecee265..ffacbf0 100644
--- a/src/page.rs
+++ b/src/page.rs
@@ -9,7 +9,7 @@ use tracing::{debug, error, trace};
use uuid::Uuid;
macro_rules! pages {
- ($($direction:ident: $fun:ident),*) => {
+ ($($direction:ident: $method:ident),*) => {
$(
doc_comment!(concat!(
@@ -22,7 +22,7 @@ macro_rules! pages {
"This allows for the next page to be retrieved in the future even when\n",
"there are no results.",
),
- pub async fn $fun(&mut self) -> Result<Option<Vec<T>>> {
+ pub async fn $method(&mut self) -> Result<Option<Vec<T>>> {
let Some(ref url) = self.$direction else {
return Ok(None);
};
@@ -208,4 +208,4 @@ fn get_links(response: &Response, call_id: Uuid) -> Result<(Option<Url>, Option<
}
Ok((prev, next))
-}
+} \ No newline at end of file