Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/ua_inspector/downloader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ defmodule UAInspector.Downloader do
alias UAInspector.Downloader.ShortCodeMapConverter
alias UAInspector.ShortCodeMap

require Logger

@client_hints [
ClientHints.Apps,
ClientHints.Browsers
Expand Down Expand Up @@ -106,8 +108,14 @@ defmodule UAInspector.Downloader do
end

defp download_file(remote, local) do
{:ok, content} = Config.downloader_adapter().read_remote(remote)

File.write!(local, content)
case Config.downloader_adapter().read_remote(remote) do
{:ok, content} ->
File.write!(local, content)
:ok

{:error, reason} ->
Logger.error("Failed to download file: #{reason}")
:ok
end
end
end