exceptions 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/README.md +29 -1
- data/Rakefile +9 -0
- data/lib/exceptions/version.rb +1 -1
- data/lib/exceptions.rb +7 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 910c40a341d6a4cf355d397393a963002b2380ce
|
4
|
+
data.tar.gz: 1578b3d249ce10de739fd74573f0245c883f2e03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ec9af3bcd29975032ebaef2a8233291961bcba951b38be8f4553d0ed26b5a83335f81fc419b31f6a8ae4ccd0346b840e8421b215eefef2a59f87fda5416f0bc
|
7
|
+
data.tar.gz: 9fb97cd1f3d7ceae037dae20c7ea85bdbe404858d65f8205ebff620c8da291e2eb09d030a3d6926c1f7afc38d3700bfdd72a2c21fd6a4791d3ec1d1821b7a70a
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Exceptions
|
1
|
+
# Exceptions [](https://travis-ci.org/remind101/exceptions)
|
2
2
|
|
3
3
|
Exceptions is a Ruby gem that provides the right amount of abstraction for doing exception
|
4
4
|
tracking in Ruby.
|
@@ -23,6 +23,17 @@ Or install it yourself as:
|
|
23
23
|
$ gem install exceptions
|
24
24
|
```
|
25
25
|
|
26
|
+
## Configuration
|
27
|
+
|
28
|
+
Exceptions provides the concept of "backends" that allow you to configure what
|
29
|
+
happens when `Exceptions.notify` is called. The following backends are provided:
|
30
|
+
|
31
|
+
* **Null**: This backend does nothing. Useful in tests.
|
32
|
+
* **Raiser**: This backend will simply raise the exception.
|
33
|
+
* **Logger**: This backend will log the exception to stdout.
|
34
|
+
* **Honeybadger**: This backend will send the exception to honeybadger using the [honeybadger-ruby](https://github.com/honeybadger-io/honeybadger-ruby) gem.
|
35
|
+
* **Multi**: A meta backend to compose other backends into a single backend.
|
36
|
+
|
26
37
|
## Usage
|
27
38
|
|
28
39
|
**Track an exception**
|
@@ -31,6 +42,23 @@ $ gem install exceptions
|
|
31
42
|
Exceptions.notify(StandardError.new("Boom"))
|
32
43
|
```
|
33
44
|
|
45
|
+
**Set context**
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
Exceptions.context(request_id: 'dc2d304c-6276-4c1f-9f0d-cc910f4487fd')
|
49
|
+
```
|
50
|
+
|
51
|
+
**Clear context**
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
Exceptions.clear_context
|
55
|
+
```
|
56
|
+
|
57
|
+
## Rack
|
58
|
+
|
59
|
+
Rack middleware is included which can be used to catch exceptions, shuttle them off somewhere and
|
60
|
+
raise the exception again.
|
61
|
+
|
34
62
|
## Contributing
|
35
63
|
|
36
64
|
1. Fork it
|
data/Rakefile
CHANGED
data/lib/exceptions/version.rb
CHANGED
data/lib/exceptions.rb
CHANGED
@@ -32,6 +32,13 @@ module Exceptions
|
|
32
32
|
backend.clear_context
|
33
33
|
end
|
34
34
|
|
35
|
+
# Public: Notify a rack exception.
|
36
|
+
#
|
37
|
+
# Returns a Result object.
|
38
|
+
def rack_exception(exception, env)
|
39
|
+
backend.rack_exception exception, env
|
40
|
+
end
|
41
|
+
|
35
42
|
# Public: The configuration object.
|
36
43
|
#
|
37
44
|
# Returns a Configuration instance.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric J. Holmes
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- .gitignore
|
77
77
|
- .rspec
|
78
|
+
- .travis.yml
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE.txt
|
80
81
|
- README.md
|