Skip to content

Commit 97ee95b

Browse files
committed
Fix some error handling
1 parent 8afced3 commit 97ee95b

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

app/Exceptions/Handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ public function invalidJson($request, ValidationException $exception)
8383
$cleaned[] = snake_case($reason);
8484
}
8585

86-
return [$field => $cleaned];
86+
return [str_replace('.', '_', $field) => $cleaned];
8787
})->toArray();
8888

8989
$errors = collect($exception->errors())->map(function ($errors, $field) use ($codes) {
9090
$response = [];
9191
foreach ($errors as $key => $error) {
9292
$response[] = [
93-
'code' => array_get($codes, $field . '.' . $key),
93+
'code' => array_get($codes, str_replace('.', '_', $field) . '.' . $key),
9494
'detail' => $error,
9595
'source' => ['field' => $field],
9696
];

app/Http/Controllers/Api/Application/Nodes/AllocationController.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ class AllocationController extends ApplicationApiController
2626
*/
2727
private $deletionService;
2828

29-
/**
30-
* @var \Spatie\Fractal\Fractal
31-
*/
32-
private $fractal;
33-
3429
/**
3530
* @var \Pterodactyl\Contracts\Repository\AllocationRepositoryInterface
3631
*/

0 commit comments

Comments
 (0)