Skip to content

Commit b69e1b4

Browse files
author
Shashank Jain
committed
Fix: api exeption handler bug fix
1 parent 49cc96e commit b69e1b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Handlers/ApiExceptionHandler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ public function render($request, \Exception $e)
5252
else {
5353
$parts = explode(".", $result[1]);
5454

55-
return ApiResponse::exception(new UnknownFieldException("Field '" . $parts[1] . "' does not exist", $e));
55+
if (count($parts) > 1) {
56+
return ApiResponse::exception(new UnknownFieldException("Field '" . $parts[1] . "' does not exist", $e));
57+
}
58+
else {
59+
return ApiResponse::exception(new UnknownFieldException("Field '" . $result . "' does not exist", $e));
60+
}
5661
}
5762
}
5863
else {

0 commit comments

Comments
 (0)