diff options
-rw-r--r-- | gemini.go | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 +} |