Browse Source

Make `ErrorResponse` implement `Error`

This allows an ErrorResponse to be used directly as an error type.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Brian Goff 6 years ago
parent
commit
6ddd43b589
1 changed files with 6 additions and 0 deletions
  1. 6 0
      api/types/error_response_ext.go

+ 6 - 0
api/types/error_response_ext.go

@@ -0,0 +1,6 @@
+package types
+
+// Error returns the error message
+func (e ErrorResponse) Error() string {
+	return e.Message
+}