protected function normalizeException($exception, array $nodes, array $path = []): ExecutionException
    {
        if ($exception instanceof \Throwable) {
            return new ExecutionException(
                $exception->getMessage(),
                $nodes,
                null,
                null,
                $path,
                null,
                $exception
            );
        }

        if (\is_string($exception)) {
            return new ExecutionException(
                $exception,
                $nodes,
                null,
                null,
                $path
            );
        }

        return new ExecutionException(
            '',
            $nodes,
            null,
            null,
            $path
        );
    }
protected function normalizeException($exception, array $nodes, array $path = []): ExecutionException
    {
        if ($exception instanceof \Throwable) {
            return new ExecutionException(
                $exception->getMessage(),
                $nodes,
                null,
                null,
                $path,
                null,
                $exception
            );
        }

        if (\is_string($exception)) {
            return new ExecutionException(
                $exception,
                $nodes,
                null,
                null,
                $path
            );
        }

        return new ExecutionException(
            '',
            $nodes,
            null,
            null,
            $path
        );
    }
protected function normalizeException ( $ exception , array $ nodes , array $ path = [ ] ) : ExecutionException { if ( $ exception instanceof \ Throwable ) { return new ExecutionException ( $ exception -> getMessage ( ) , $ nodes , null , null , $ path , null , $ exception ) ; } if ( \ is_string ( $ exception ) ) { return new ExecutionException ( $ exception , $ nodes , null , null , $ path ) ; } return new ExecutionException ( '' , $ nodes , null , null , $ path ) ; }
Normalizes exceptions which are usually a \Throwable,
but can even be a string or null when resolving promises.

@param mixed           $exception
@param NodeInterface[] $nodes
@param array           $path
@return ExecutionException
Normalizes exceptions which are usually a \ Throwable but can even be a string or null when resolving promises .