src/Exception/FlattenException.php
public static function create(\Exception $exception, $statusCode = null, array $headers = [])
    {
        if (!$exception instanceof BaseException) {
            throw new \RuntimeException(\sprintf('You should only try to create an instance of "%s" with a "EasyCorp\Bundle\EasyAdminBundle\Exception\BaseException" instance, or subclass. "%s" given.', __CLASS__, \get_class($exception)));
        }

        /** @var FlattenException $e */
        $e = parent::create($exception, $statusCode, $headers);
        $e->context = $exception->getContext();

        return $e;
    }
public static function create(\Exception $exception, $statusCode = null, array $headers = [])
    {
        if (!$exception instanceof BaseException) {
            throw new \RuntimeException(\sprintf('You should only try to create an instance of "%s" with a "EasyCorp\Bundle\EasyAdminBundle\Exception\BaseException" instance, or subclass. "%s" given.', __CLASS__, \get_class($exception)));
        }

        /** @var FlattenException $e */
        $e = parent::create($exception, $statusCode, $headers);
        $e->context = $exception->getContext();

        return $e;
    }
@param \Exception $exception
@param int        $statusCode
@param array      $headers

@return FlattenException

@throws \RuntimeException