Sfoglia il codice sorgente

throw exception on invalid entity

Luciano Andrade 7 anni fa
parent
commit
63696b493d
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      Controller/RESTController.php

+ 1 - 1
Controller/RESTController.php

@@ -276,7 +276,7 @@ abstract class RESTController extends VoryxController
                 $em->flush();
                 return $entity;
             } else {
-                var_dump($this->getFormFieldError($form));
+               throw new \Exception("Entity ". (string) $entity . " is not valid");
             }
             return FOSView::create(array('errors' => $form->getErrors()), Codes::HTTP_INTERNAL_SERVER_ERROR);
         } catch (\Exception $e) {