Skip to content

Commit

Permalink
Fix stacktrace issue
Browse files Browse the repository at this point in the history
  • Loading branch information
acconrad committed Feb 25, 2020
1 parent 3d175dd commit 13f69a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: elixir
matrix:
include:
- otp_release: 20.3
elixir: 1.7.1
- otp_release: 21.0
elixir: 1.7.2
env: MIX_ENV=test
- otp_release: 22.0
elixir: 1.10.1
Expand Down
7 changes: 5 additions & 2 deletions lib/slack/bot.ex
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ defmodule Slack.Bot do
{:close, reason, state}
rescue
e ->
Logger.error(__STACKTRACE__)
handle_exception(e)
{:close, reason, state}
end
Expand All @@ -133,6 +134,7 @@ defmodule Slack.Bot do
{:ok, %{state | process_state: new_process_state}}
rescue
e ->
Logger.error(__STACKTRACE__)
handle_exception(e)
{:ok, state}
end
Expand Down Expand Up @@ -162,7 +164,9 @@ defmodule Slack.Bot do
{:ok, new_process_state} = bot_handler.handle_event(message, slack, process_state)
new_process_state
rescue
e -> handle_exception(e)
e ->
Logger.error(__STACKTRACE__)
handle_exception(e)
end
else
process_state
Expand All @@ -183,7 +187,6 @@ defmodule Slack.Bot do
defp handle_exception(e) do
message = Exception.message(e)
Logger.error(message)
System.stacktrace() |> Exception.format_stacktrace() |> Logger.error()
raise message
end
end

0 comments on commit 13f69a7

Please sign in to comment.