   defp retry_line(%{retry: nil}) do
     []
   end
-  defp retry_line(%{retry: retry}) do
-    single_line?(retry) || raise "Bad"
-    ["retry: " <> retry]
+  defp retry_line(%{retry: retry}) when is_integer(retry) do
+    ["retry: " <> to_string(retry)]
   end
 
   defp single_line?(text) do


  """
  # parse_block block has comments event does not
  def parse(stream, event \\ %__MODULE__{}) do
    case pop_line(stream) do
      nil ->
        nil

    comments: []
  ]

  @doc """
  This event stream format's MIME type is `text/event-stream`.
  """
  def mime_type do
    "text/event-stream"
  end

  @doc """
  Does the event have any data lines.

  An event without any data lines will not trigger any browser events.
  """
  def empty?(%{lines: []}), do: true
  def empty?(%{lines: _}), do: false

  @doc """
  Format an event to be sent as part of a stream

  **NOTE:** Each data/comment line must be without new line charachters.

  ## Examples
  *In these examples this module has been aliased to `SSE`*.

      iex> %SSE{type: "greeting", lines: ["Hi,", "there"], comments: ["comment"]}
      ...> |> SSE.serialize()
      "event: greeting\\n: comment\\ndata: Hi,\\ndata: there"

      iex> %SSE{lines: ["message with id"], id: "some-id"}
      ...> |> SSE.serialize()
      "data: message with id\\nid: some-id"

      iex> %SSE{lines: ["message setting retry to 10s"], retry: 10_000}
      ...> |> SSE.serialize()
      "data: message setting retry to 10s\\nretry: 10000"
  """
  def serialize(event = %__MODULE__{}) do
    type_line(event)
