Add thiserror instead of exposing eyre anonymous errors

The change here is to make it easier for the consumer to debug the api.
Such that they can `match` on individual errors instead of having to
parse text.

eyre is convenient, but mostly from a consumers perspective
This commit is contained in:
2023-04-30 12:57:50 +02:00
committed by Kasper Juul Hermansen
parent 66ab2f552c
commit 3a9abb97c2
12 changed files with 157 additions and 71 deletions

View File

@@ -111,9 +111,9 @@ async fn test_err_message() {
assert_eq!(alpine.is_err(), true);
let err = alpine.expect_err("Tests expect err");
let error_msg = r#"
GQLClient Error: Look at json field for more details
Message: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
let error_msg = r#"failed to query dagger engine: domain error:
Look at json field for more details
pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
"#;
assert_eq!(err.to_string().as_str(), error_msg);