aboutsummaryrefslogtreecommitdiff
path: root/errors.go
diff options
context:
space:
mode:
Diffstat (limited to 'errors.go')
-rw-r--r--errors.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/errors.go b/errors.go
new file mode 100644
index 0000000..25e9e0c
--- /dev/null
+++ b/errors.go
@@ -0,0 +1,15 @@
+package inwx
+
+import "fmt"
+
+// ErrUnexpectedStatus indicates that a Call was responded to
+// but the Status doesn't match any of the expected Statuses of the Call.
+type ErrUnexpectedStatus struct {
+ Expected []Status
+ Got Status
+}
+
+func (e *ErrUnexpectedStatus) Error() string {
+ const format = "unexpected status code: expected %v, got %v"
+ return fmt.Sprintf(format, e.Expected, e.Got)
+}