fserrors: Look deeper into errors for Fatal/Retry/NoRetry errors.
Before this change fatal errors which were wrapped in a system error (eg a URLError) were not recognised as fatal errors.
This commit is contained in:
parent
be79b47a7a
commit
f95835d613
1 changed files with 3 additions and 3 deletions
|
@ -69,7 +69,7 @@ func IsRetryError(err error) bool {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
err = errors.Cause(err)
|
_, err = Cause(err)
|
||||||
if r, ok := err.(Retrier); ok {
|
if r, ok := err.(Retrier); ok {
|
||||||
return r.Retry()
|
return r.Retry()
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ func IsFatalError(err error) bool {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
err = errors.Cause(err)
|
_, err = Cause(err)
|
||||||
if r, ok := err.(Fataler); ok {
|
if r, ok := err.(Fataler); ok {
|
||||||
return r.Fatal()
|
return r.Fatal()
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ func IsNoRetryError(err error) bool {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
err = errors.Cause(err)
|
_, err = Cause(err)
|
||||||
if r, ok := err.(NoRetrier); ok {
|
if r, ok := err.(NoRetrier); ok {
|
||||||
return r.NoRetry()
|
return r.NoRetry()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue