Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log backtrace of exceptions in commands. #185

Merged
merged 1 commit into from
Apr 22, 2018
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 0.11.1 (Next)

* [#185](https://github.com/slack-ruby/slack-ruby-bot/pull/185): Log backtrace of exceptions - [@dblock](https://github.com/dblock).
* Your contribution here.

### 0.11.0 (04/02/2018)
Expand Down
3 changes: 2 additions & 1 deletion lib/slack-ruby-bot/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def handle_exceptions
logger.error e
sleep 1 # ignore, try again
rescue StandardError => e
logger.error e
logger.error e.message
logger.error e.backtrace.join("\n")
raise e
ensure
@client = nil
Expand Down
2 changes: 1 addition & 1 deletion spec/slack-ruby-bot/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
allow(subject).to receive(:sleep)
allow(SlackRubyBot::Server).to receive(:auth!)
expect(Slack::RealTime::Client).to receive(:new).twice.and_return(client)
expect(logger).to receive(:error).twice
allow(logger).to receive(:error)
end
it 'migration_in_progress', vcr: { cassette_name: 'migration_in_progress' } do
expect do
Expand Down