public static function conversionFailedSerialization($value, $format, $error, Exception $e = null)
    {
        $actualType = is_object($value) ? get_class($value) : gettype($value);

        return new self(sprintf(
            "Could not convert PHP type '%s' to '%s', as an error was triggered by the serialization: %s",
            $actualType,
            $format,
            $error
        ), 0, $e);
    }