public function putAction(Request $request, $id)
    {
        try {
            $shipping = $this->getManager()->save(
                $request->request->all(),
                $this->getLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale')),
                $this->getUser()->getId(),
                $id
            );

            $view = $this->view($shipping, 200);
        } catch (ShippingNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 404);
        } catch (ShippingDependencyNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 400);
        } catch (MissingShippingAttributeException $exc) {
            $exception = new MissingArgumentException(self::$shippingEntityName, $exc->getAttribute());
            $view = $this->view($exception->toArray(), 400);
        } catch (ShippingException $exc) {
            $exception = new RestException($exc->getMessage());
            $view = $this->view($exception->toArray(), 400);
        }

        return $this->handleView($view);
    }