Commit 6827f06aa7c615969b7ca8dc0cd57000f30bfdd9
1 parent
acc83a8d
email validation
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
app/library/App/Controllers/UserController.php
@@ -129,8 +129,7 @@ class UserController extends CrudResourceController | @@ -129,8 +129,7 @@ class UserController extends CrudResourceController | ||
129 | $messages = $validation->validate($data); | 129 | $messages = $validation->validate($data); |
130 | 130 | ||
131 | if (count($messages)) { | 131 | if (count($messages)) { |
132 | - throw new Exception(ErrorCodes::DATA_FAILED, 'Unable to create item', [ | ||
133 | - 'message' => $messages[0], | 132 | + throw new Exception(ErrorCodes::POST_DATA_INVALID, 'The e-mail is not valid', [ |
134 | 'data' => $data[$email_field] | 133 | 'data' => $data[$email_field] |
135 | ]); | 134 | ]); |
136 | } | 135 | } |