Update handlers.go

Changed httpError for failing to coplete order to "http.StatusBadRequest"
This commit is contained in:
marcfong 2019-08-23 16:01:20 +08:00 committed by GitHub
parent 3f577b60a0
commit c156f7f935
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -286,7 +286,7 @@ func (fe *frontendServer) placeOrderHandler(w http.ResponseWriter, r *http.Reque
Country: country}, Country: country},
}) })
if err != nil { if err != nil {
renderHTTPError(log, r, w, errors.Wrap(err, "failed to complete the order"), http.StatusInternalServerError) renderHTTPError(log, r, w, errors.Wrap(err, "failed to complete the order"), http.StatusBadRequest)
return return
} }
log.WithField("order", order.GetOrder().GetOrderId()).Info("order placed") log.WithField("order", order.GetOrder().GetOrderId()).Info("order placed")