File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ type APIResponseMetaContainer interface {
98
98
type APIResponse interface {
99
99
APIResponseMetaContainer
100
100
101
+ // Err must return the current state error, or nil if beginning state.
102
+ Err () error
103
+
101
104
// Read returns the raw bytes from the HTTP response body. Once called
102
105
//
103
106
// This action is mutually exclusive with Hydrate.
@@ -153,6 +156,14 @@ func (b *RawAPIResponse) ResponseMeta() APIResponseMeta {
153
156
return b .meta
154
157
}
155
158
159
+ // Err returns the current state error, if there is one.
160
+ func (b * RawAPIResponse ) Err () error {
161
+ b .mu .Lock ()
162
+ err := b .err
163
+ b .mu .Unlock ()
164
+ return err
165
+ }
166
+
156
167
// Read performs a read from the response body. Once this has been called, any Hydrate implementation will fail with an
157
168
// error
158
169
func (b * RawAPIResponse ) Read (p []byte ) (int , error ) {
You can’t perform that action at this time.
0 commit comments