public static function serialize()

in src/Elastic/Types/Error.php [43:51]


    public static function serialize(Throwable $throwable): array
    {
        return [
            'type'        => get_class($throwable),
            'message'     => $throwable->getMessage(),
            'code'        => $throwable->getCode(),
            'stack_trace' => $throwable->__toString(),
        ];
    }