From 1d788afbbbc68f5482a2e0048e9baf4d77527d9e Mon Sep 17 00:00:00 2001 From: Sebastian Borrazas Date: Fri, 26 Apr 2024 08:46:39 -0300 Subject: [PATCH] fix: handle not found auction bids (#1746) --- lib/ae_mdw_web/controllers/name_controller.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ae_mdw_web/controllers/name_controller.ex b/lib/ae_mdw_web/controllers/name_controller.ex index cc78c7327..a910fb762 100644 --- a/lib/ae_mdw_web/controllers/name_controller.ex +++ b/lib/ae_mdw_web/controllers/name_controller.ex @@ -57,8 +57,12 @@ defmodule AeMdwWeb.NameController do def auction(%Conn{assigns: %{state: state, opts: opts}} = conn, %{"id" => ident}) do opts = [{:render_v3?, true} | opts] - with {:ok, auction_bid} <- AuctionBids.fetch(state, ident, opts) do - format_json(conn, auction_bid) + case AuctionBids.fetch(state, ident, opts) do + {:ok, auction_bid} -> + format_json(conn, auction_bid) + + :not_found -> + {:error, ErrInput.NotFound.exception(value: ident)} end end