diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/zkevm_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/zkevm_controller.ex index a92589e029..171a63d57a 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/zkevm_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/zkevm_controller.ex @@ -28,16 +28,19 @@ defmodule BlockScoutWeb.API.V2.ZkevmController do """ @spec batch(Plug.Conn.t(), map()) :: Plug.Conn.t() def batch(conn, %{"batch_number" => batch_number} = _params) do - {:ok, batch} = - Reader.batch( - batch_number, - necessity_by_association: @batch_necessity_by_association, - api?: true - ) + case Reader.batch( + batch_number, + necessity_by_association: @batch_necessity_by_association, + api?: true + ) do + {:ok, batch} -> + conn + |> put_status(200) + |> render(:zkevm_batch, %{batch: batch}) - conn - |> put_status(200) - |> render(:zkevm_batch, %{batch: batch}) + {:error, :not_found} = res -> + res + end end @doc """