Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns_update::Error does not implement std::error::Error #8

Open
jcgruenhage opened this issue Oct 4, 2024 · 0 comments
Open

dns_update::Error does not implement std::error::Error #8

jcgruenhage opened this issue Oct 4, 2024 · 0 comments

Comments

@jcgruenhage
Copy link

This makes usage in places where errors are expected to implement this trait difficult. The simplest patch for this would look like this:

commit b606c5a4964d0b2def6e13fa5c968d1da14ba0b2
Author: Jan Christian Grünhage <jan.christian@gruenhage.xyz>
Date:   Fri Oct 4 13:14:41 2024 +0200

    wip: improve error handling

diff --git a/Cargo.toml b/Cargo.toml
index 323dad8..1aaa8b0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,6 +19,7 @@ serde = { version = "1.0.197", features = ["derive"] }
 serde_json = "1.0.116"
 reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-webpki-roots", "http2"]}
 serde_urlencoded = "0.7.1"
+thiserror = "1.0.64"
 
 [dev-dependencies]
 tokio = { version = "1", features = ["full"] }
diff --git a/src/lib.rs b/src/lib.rs
index fcb2354..a71781c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,11 +23,12 @@ use providers::{
     cloudflare::CloudflareProvider,
     rfc2136::{DnsAddress, Rfc2136Provider},
 };
+use thiserror::Error;
 
 pub mod http;
 pub mod providers;
 
-#[derive(Debug)]
+#[derive(Debug, Error)]
 pub enum Error {
     Protocol(String),
     Parse(String),

It probably makes sense to put a bit more effort into this and think about error handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant