Merge branch 'master' of gburri.org:gandi_dns_update
[gandi_dns_update.git] / src / error.rs
diff --git a/src/error.rs b/src/error.rs
new file mode 100644 (file)
index 0000000..e047f56
--- /dev/null
@@ -0,0 +1,15 @@
+// A generic result of type 'T'.\r
+pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;\r
+\r
+#[derive(Debug)]\r
+pub struct Error {\r
+    pub message: String,\r
+}\r
+\r
+impl std::fmt::Display for Error {\r
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\r
+        write!(f, "Error: {}", &self.message)\r
+    }\r
+}\r
+\r
+impl std::error::Error for Error {}\r