Skip to content

Commit

Permalink
Use modern way of print a stacktrace from the worker (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
oltarasenko committed Nov 10, 2020
1 parent 66f0b3d commit cca29db
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/crawly/worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,12 @@ defmodule Crawly.Worker do
{:ok, {parsed_item, response, spider_name}}
catch
error, reason ->
stacktrace = :erlang.get_stacktrace()

Logger.debug(
"Could not parse item, error: #{inspect(error)}, reason: #{
inspect(reason)
}, stacktrace: #{inspect(stacktrace)}
"
}"
)
Logger.debug(Exception.format(:error, error, __STACKTRACE__))

{:error, reason}
end
Expand Down

0 comments on commit cca29db

Please sign in to comment.