MM-10863: Handle non-API errors with redirect to webapp (#8943)
* MM-10863: Handle non-API errors with redirect to webapp * Properly shutdown the app in the new test
Этот коммит содержится в:
коммит произвёл
Carlos Tadeu Panato Junior
родитель
a6d815e05a
Коммит
695c5d6bf8
@@ -157,8 +157,12 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
c.Err.IsOAuth = false
|
||||
}
|
||||
|
||||
w.WriteHeader(c.Err.StatusCode)
|
||||
w.Write([]byte(c.Err.ToJson()))
|
||||
if IsApiCall(r) || len(r.Header.Get("X-Mobile-App")) > 0 {
|
||||
w.WriteHeader(c.Err.StatusCode)
|
||||
w.Write([]byte(c.Err.ToJson()))
|
||||
} else {
|
||||
utils.RenderWebAppError(w, r, c.Err, c.App.AsymmetricSigningKey())
|
||||
}
|
||||
|
||||
if c.App.Metrics != nil {
|
||||
c.App.Metrics.IncrementHttpError()
|
||||
|
||||
Ссылка в новой задаче
Block a user