mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-25 22:36:02 +03:00
Better located error handling
This commit is contained in:
parent
81986145fe
commit
87c812b221
@ -79,8 +79,13 @@ class Error extends \Exception implements \JsonSerializable, ClientAware
|
||||
*/
|
||||
public static function createLocatedError($error, $nodes = null, $path = null)
|
||||
{
|
||||
if ($error instanceof self && $error->path) {
|
||||
if ($error instanceof self) {
|
||||
if ($error->path && $error->nodes) {
|
||||
return $error;
|
||||
} else {
|
||||
$nodes = $nodes ?: $error->nodes;
|
||||
$path = $path ?: $error->path;
|
||||
}
|
||||
}
|
||||
|
||||
$source = $positions = $originalError = null;
|
||||
|
Loading…
Reference in New Issue
Block a user