Replace inspect(reason) with friendly error messages

Closes #81
This commit is contained in:
Claudio Ortolina
2026-03-05 20:25:13 +00:00
parent e8f393c5a0
commit 08f7565d44
18 changed files with 542 additions and 64 deletions
@@ -21,6 +21,7 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
alias MusicLibrary.{Records, RecordSets, ScrobbleActivity}
alias MusicLibrary.Records.Similarity
alias MusicLibraryWeb.ErrorMessages
alias Phoenix.LiveView.JS
@impl true
@@ -370,7 +371,8 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
socket
|> put_toast(
:error,
gettext("Error refreshing MusicBrainz data") <> "," <> inspect(reason)
gettext("Error refreshing MusicBrainz data") <>
": " <> ErrorMessages.friendly_message(reason)
)}
end
end
@@ -389,7 +391,7 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
socket
|> put_toast(
:error,
gettext("Error") <> "," <> inspect(reason)
gettext("Error") <> ": " <> ErrorMessages.friendly_message(reason)
)}
end
end
@@ -409,7 +411,7 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
socket
|> put_toast(
:error,
gettext("Error refreshing cover") <> "," <> inspect(reason)
gettext("Error refreshing cover") <> ": " <> ErrorMessages.friendly_message(reason)
)}
end
end
@@ -429,7 +431,7 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
socket
|> put_toast(
:error,
gettext("Error extracting colors") <> ": " <> inspect(reason)
gettext("Error extracting colors") <> ": " <> ErrorMessages.friendly_message(reason)
)}
end
end
@@ -448,7 +450,7 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
socket
|> put_toast(
:error,
gettext("Error") <> "," <> inspect(reason)
gettext("Error") <> ": " <> ErrorMessages.friendly_message(reason)
)}
end
end