public void Edit(CartItem cartItem) { try { var bc = new CartItemBusiness(); bc.EditProduct(cartItem); } catch (Exception ex) { // Repack to Http error. var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }