 
       {:ok, metadata}
     else
-      {:ok, :eof} ->
-        {:error, :unknown_format}
-
       {:ok, %{"version" => version}} ->
         {:error, {:unsupported_format, version}}
 
-      {:error, :invalid} ->
+      otherwise ->
+        Logger.warn("error extracting v2 metadata: #{inspect(otherwise)}")
         {:error, :unknown_format}
     end
   end

defmodule Asciinema.Asciicasts do
  import Ecto.Query, warn: false
  alias Asciinema.{Repo, FileStore, StringUtils, Vt}
  alias Asciinema.Asciicasts.{Asciicast, SnapshotUpdater}

      {:ok, %{"version" => version}} ->
        {:error, {:unsupported_format, version}}

      otherwise ->
        Logger.warn("error extracting v1 metadata: #{inspect(otherwise)}")
        {:error, :unknown_format}
    end
  end
