diff --git a/CHANGELOG.md b/CHANGELOG.md index df833ee4..1b964384 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -128,6 +128,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release. - `Schema` field from the `Connection` struct (#7) - `OkCode` and `PushCode` constants (#237) - SSL support (#301) +- `Future.Err()` method (#382) ### Fixed diff --git a/README.md b/README.md index 39a169be..b784b344 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,9 @@ for an `ops` field. `*Operations` needs to be used instead. * `Future` constructors now accept `Request` as their argument. * Methods `AppendPush` and `SetResponse` accepts response `Header` and data as their arguments. +* Method `Err` was removed because it was causing improper error handling. You + You need to check an error from `Get`, `GetTyped` or `GetResponse` with + an addition check of a value `Response.Header().Error`, see `ExampleErrorNo`. #### Connector changes diff --git a/future.go b/future.go index 1b9f2ed1..64e2805f 100644 --- a/future.go +++ b/future.go @@ -266,11 +266,3 @@ func (fut *Future) WaitChan() <-chan struct{} { } return fut.done } - -// Err returns error set on Future. -// It waits for future to be set. -// Note: it doesn't decode body, therefore decoding error are not set here. -func (fut *Future) Err() error { - fut.wait() - return fut.err -}