浏览代码

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 年之前
父节点
当前提交
6ddd43b589
共有 1 个文件被更改,包括 6 次插入0 次删除
  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
+}