feat(integrations): added extra 422 error code for createIntegration method
This commit is contained in:
parent
3188b0ad6f
commit
6d5629872a
1 changed files with 5 additions and 1 deletions
|
|
@ -73,7 +73,11 @@ func (e *Router) createIntegration(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
if err := e.services.Integrator.AddIntegration(project, integration, req.IntegrationData); err != nil {
|
||||
e.ResponseWithError(r.Context(), w, http.StatusInternalServerError, err, startTime, r.URL.Path, bodySize)
|
||||
if strings.Contains(err.Error(), "failed to validate") {
|
||||
e.ResponseWithError(r.Context(), w, http.StatusUnprocessableEntity, err, startTime, r.URL.Path, bodySize)
|
||||
} else {
|
||||
e.ResponseWithError(r.Context(), w, http.StatusInternalServerError, err, startTime, r.URL.Path, bodySize)
|
||||
}
|
||||
return
|
||||
}
|
||||
e.ResponseOK(r.Context(), w, startTime, r.URL.Path, bodySize)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue