mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-17 18:49:15 +00:00
Ensure we can't crash out on unusual logger backend settings
This commit is contained in:
parent
59af68c600
commit
368b22fd2f
|
@ -158,8 +158,9 @@ def load_all_pleroma_modules do
|
|||
|> String.to_existing_atom()
|
||||
|> Code.ensure_loaded!()
|
||||
end)
|
||||
|
||||
# Use this when 1.15 is standard
|
||||
#|> Code.ensure_all_loaded!()
|
||||
# |> Code.ensure_all_loaded!()
|
||||
end
|
||||
|
||||
defp cachex_children do
|
||||
|
|
|
@ -110,7 +110,7 @@ defp merge_with_default(%{group: group, key: key, value: value} = setting) do
|
|||
|
||||
defp configure({_, :backends, _, merged}) do
|
||||
# removing current backends
|
||||
Enum.each(Application.get_env(:logger, :backends), &Logger.remove_backend/1)
|
||||
Enum.each(Application.get_env(:logger, :backends, []), &Logger.remove_backend/1)
|
||||
|
||||
Enum.each(merged, &Logger.add_backend/1)
|
||||
|
||||
|
|
|
@ -34,9 +34,7 @@ def perform(%Plug.Conn{assigns: assigns} = conn, %{scopes: scopes} = options) do
|
|||
permissions = Enum.join(missing_scopes, " #{op} ")
|
||||
|
||||
error_message =
|
||||
dgettext("errors", "Insufficient permissions: %{permissions}.",
|
||||
permissions: permissions
|
||||
)
|
||||
dgettext("errors", "Insufficient permissions: %{permissions}.", permissions: permissions)
|
||||
|
||||
conn
|
||||
|> put_resp_content_type("application/json")
|
||||
|
|
Loading…
Reference in a new issue