Split in modules
[gandi_dns_update.git] / src / error.rs
diff --git a/src/error.rs b/src/error.rs
new file mode 100644 (file)
index 0000000..12221fb
--- /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 { }
\ No newline at end of file