mirror of
https://github.com/simon987/Architeuthis.git
synced 2025-04-18 07:16:42 +00:00
return response even on error (WIP)
This commit is contained in:
parent
dfa66c9533
commit
3008ab5843
8
main.go
8
main.go
@ -35,7 +35,11 @@ func New() *Architeuthis {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Trace("Could not complete request")
|
logrus.WithError(err).Trace("Could not complete request")
|
||||||
return nil, goproxy.NewResponse(r, "text/plain", http.StatusInternalServerError, err.Error())
|
if resp != nil {
|
||||||
|
return nil, resp
|
||||||
|
} else {
|
||||||
|
return nil, goproxy.NewResponse(r, "text/plain", http.StatusInternalServerError, err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, resp
|
return nil, resp
|
||||||
@ -115,7 +119,7 @@ func (a *Architeuthis) processRequest(r *http.Request) (*http.Response, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !responseCtx.ShouldRetry {
|
if !responseCtx.ShouldRetry {
|
||||||
return nil, responseCtx.Error
|
return responseCtx.Response, responseCtx.Error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user