Improve error messages when adding a non-valid source URL (#436)

This commit is contained in:
Kieran authored and GitHub committed 2024-10-25 11:01:46 -07:00
1 parent 6a1b7b0160
commit 108a141c65
4 files changed
+21 -2

No files matched your search

+7 -1
View File
@@ -186,7 +186,13 @@ defmodule Pinchflat.Sources do
{:ok, source_details} ->
add_source_details_by_collection_type(source, changeset, source_details)
{:error, runner_error, _status_code} ->
err ->
runner_error =
case err do
{:error, error_msg, _status_code} -> error_msg
{:error, error_msg} -> error_msg
end
Ecto.Changeset.add_error(
changeset,
:original_url,