#[non_exhaustive]pub enum QueryError<E>{
Transport {
source: E,
},
Api {
message: String,
method: &'static str,
kind: ApiErrorKind,
},
NonJsonBody {
method: &'static str,
body: String,
},
Decode {
source: Error,
method: &'static str,
},
Build {
source: Error,
},
Encode {
source: Error,
},
}Expand description
Error returned by Query::execute, generic over the transport error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Transport
Underlying transport failure (DNS, TLS, timeout, header build, …).
Fields
§
source: EApi
Matomo returned {"result":"error", ...} with HTTP 200.
NonJsonBody
The body was not JSON at all (e.g. an HTML error page). The captured body is sanitized and truncated to 2 KiB.
Decode
The body was valid JSON but did not match the expected typed shape.
Build
Failed to construct the HTTP request.
Encode
Failed to url-encode the form body.
Implementations§
Trait Implementations§
Source§impl<E> Debug for QueryError<E>
impl<E> Debug for QueryError<E>
Source§impl<E> Display for QueryError<E>
impl<E> Display for QueryError<E>
Source§impl<E> Error for QueryError<E>
impl<E> Error for QueryError<E>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl<E> From<Error> for QueryError<E>
impl<E> From<Error> for QueryError<E>
Auto Trait Implementations§
impl<E> !RefUnwindSafe for QueryError<E>
impl<E> !UnwindSafe for QueryError<E>
impl<E> Freeze for QueryError<E>where
E: Freeze,
impl<E> Send for QueryError<E>
impl<E> Sync for QueryError<E>
impl<E> Unpin for QueryError<E>where
E: Unpin,
impl<E> UnsafeUnpin for QueryError<E>where
E: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more