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

airbrake-ruby: don't raise error when there's no project id/key #458

Merged
merged 1 commit into from
Mar 14, 2019
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Airbrake Ruby Changelog

### master

* Stopped raising `Airbrake::Error` when configuring Airbrake without a project
id or project key ([#458](https://github.com/airbrake/airbrake-ruby/pull/458))

### [v4.2.0][v4.2.0] (March 7, 2019)

* Added `Airbrake.notify_performance_breakdown` that sends performance data by
Expand Down
7 changes: 0 additions & 7 deletions lib/airbrake-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,9 @@ class << self
# @return [void]
# @raise [Airbrake::Error] when trying to reconfigure already
# existing notifier
# @raise [Airbrake::Error] when either +project_id+ or +project_key+
# is missing (or both)
# @note There's no way to read config values outside of this library
def configure
yield config = Airbrake::Config.instance

if (result = config.validate).rejected?
raise Airbrake::Error, result.value['error']
end

Airbrake::Loggable.instance = config.logger
end

Expand Down
14 changes: 0 additions & 14 deletions spec/airbrake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,5 @@

expect(Airbrake::Loggable.instance).to eql(logger)
end

context "when user config doesn't contain a project id" do
it "raises error" do
expect { described_class.configure { |c| c.project_key = '1' } }
.to raise_error(Airbrake::Error, ':project_id is required')
end
end

context "when user config doesn't contain a project key" do
it "raises error" do
expect { described_class.configure { |c| c.project_id = 1 } }
.to raise_error(Airbrake::Error, ':project_key is required')
end
end
end
end