Correctly json_encode validation errors.

This commit is contained in:
Dane Everitt
2017-03-16 19:30:04 -04:00
parent 05d2a6d370
commit 5bbded2c03
7 changed files with 16 additions and 16 deletions

View File

@@ -60,7 +60,7 @@ class NodeRepository
// Run validator, throw catchable and displayable exception if it fails.
// Exception includes a JSON result of failed validation rules.
if ($validator->fails()) {
throw new DisplayValidationException($validator->errors());
throw new DisplayValidationException(json_encode($validator->errors()));
}
// Verify the FQDN if using SSL
@@ -109,7 +109,7 @@ class NodeRepository
// Run validator, throw catchable and displayable exception if it fails.
// Exception includes a JSON result of failed validation rules.
if ($validator->fails()) {
throw new DisplayValidationException($validator->errors());
throw new DisplayValidationException(json_encode($validator->errors()));
}
// Verify the FQDN
@@ -193,7 +193,7 @@ class NodeRepository
]);
if ($validator->fails()) {
throw new DisplayValidationException($validator->errors());
throw new DisplayValidationException(json_encode($validator->errors()));
}
$explode = explode('/', $data['allocation_ip']);