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

Configurable Exception Raising for rollbar.log #449

Merged
merged 7 commits into from
Apr 28, 2019

Conversation

ArturMoczulski
Copy link
Contributor

@ArturMoczulski ArturMoczulski commented Apr 17, 2019

Fixes #448

Usage:

$enviroment = "test";

Rollbar::init(array(
  "access_token" => $this->getTestAccessToken(),
  "environment" => $environment,
  "raise_on_error" => $environment == "test"
));

try {
  throw new \Exception();
} catch(\Exception $ex) {
  Rollbar::log(Level::ERROR, $ex);
}

Above configuration will cause the exception to be reraised only in the test environment

@ArturMoczulski ArturMoczulski added the Type: Enhancement Changes that add to, improve upon, enhance, or extend the existing component. label Apr 17, 2019
@ArturMoczulski ArturMoczulski self-assigned this Apr 17, 2019
@ArturMoczulski ArturMoczulski changed the title Reraise exceptions in configured environments Re-raise exceptions in configured environments Apr 17, 2019
@ArturMoczulski ArturMoczulski changed the title Re-raise exceptions in configured environments Configurable Exception Re-raising Apr 26, 2019
@ArturMoczulski ArturMoczulski changed the title Configurable Exception Re-raising Configurable Exception Raising for rollbar.log Apr 26, 2019
@waltjones
Copy link
Contributor

LGTM

Side note: in the description example, Rollbar::log isn't using the $ex that's passed in. If this gets cut/pasted for a doc example, look out for that.

@ArturMoczulski
Copy link
Contributor Author

Thanks for pointing that out @waltjones fixed it

@ArturMoczulski
Copy link
Contributor Author

Once this is released, raise_on_error needs to get added to the doc

@ArturMoczulski
Copy link
Contributor Author

@bishopb bishopb deleted the 448-reraise-exceptions-config branch December 31, 2020 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Changes that add to, improve upon, enhance, or extend the existing component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-raise exceptions in test and development environments based on a config option
2 participants