aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gemini.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/gemini.go b/gemini.go
index 5ebaa6a..14eb048 100644
--- a/gemini.go
+++ b/gemini.go
@@ -1,5 +1,7 @@
package gemini
+import "fmt"
+
// Gemini status codes as defined in the Gemini spec Appendix 1.
const (
StatusInput = 10
@@ -35,3 +37,16 @@ const (
func SimplifyStatus(status int) int {
return (status / 10) * 10
}
+
+type Error struct {
+ Err error
+ Status int
+}
+
+func (e Error) Error() string {
+ return fmt.Sprintf("Status %d: %v", e.Status, e.Err)
+}
+
+func (e Error) Unwrap() error {
+ return e.Err
+}