diff --git a/lib/frenzy/pipeline/scrape_stage.ex b/lib/frenzy/pipeline/scrape_stage.ex index 823ae4c..653ee63 100644 --- a/lib/frenzy/pipeline/scrape_stage.ex +++ b/lib/frenzy/pipeline/scrape_stage.ex @@ -18,11 +18,10 @@ defmodule Frenzy.Pipeline.ScrapeStage do @impl Stage def validate_opts(opts) when is_map(opts) do - # todo: figure out why this errors when an empty map is provided opts = case opts["extractor"] do nil -> - {:ok, %{opts | extractor: "builtin"}} + {:ok, Map.put(opts, "extractor", "builtin")} extractor when not is_binary(extractor) -> {:error, "extractor must be a string"} @@ -44,7 +43,7 @@ defmodule Frenzy.Pipeline.ScrapeStage do {:ok, opts} -> case opts["convert_to_data_uris"] do nil -> - {:ok, %{opts | convert_to_data_uris: true}} + {:ok, Map.put(opts, "convert_to_data_uris", true)} value when is_boolean(value) -> {:ok, opts} diff --git a/lib/frenzy_web/controllers/pipeline_controller.ex b/lib/frenzy_web/controllers/pipeline_controller.ex index 3ed33fa..6c72ff5 100644 --- a/lib/frenzy_web/controllers/pipeline_controller.ex +++ b/lib/frenzy_web/controllers/pipeline_controller.ex @@ -105,7 +105,7 @@ defmodule FrenzyWeb.PipelineController do else {:error, reason} -> conn - |> put_flash(:error, "Unable to edit pipeline: #{inspect(reason)}") + |> put_flash(:error, "Unable to edit pipeline: #{reason}") |> render("edit.html", %{ pipeline: pipeline, name: name, @@ -123,7 +123,7 @@ defmodule FrenzyWeb.PipelineController do {:cont, {:ok, new_stages ++ [stage]}} {:error, reason} -> - {:error, "invalid stage at #{index}: #{reason}"} + {:halt, {:error, "invalid stage at index #{index}: #{reason}"}} end end) end