eh 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +2 -0
  2. data/lib/eh/eh.rb +18 -17
  3. data/lib/eh/version.rb +1 -1
  4. metadata +12 -12
data/README.md CHANGED
@@ -107,6 +107,8 @@ When :exception_filter is provided to run!(), only the exceptions in the filter
107
107
 
108
108
  When :exception_filter is provided to run(), only the exceptions in the filter are logged, if a logger is provided. Exceptions are not re-raised.
109
109
 
110
+ All exceptions are passed to all handlers, regardless of exception filter. It is up to the handler to filter out exceptions it is not interested in.
111
+
110
112
  Unhandled exceptions can be logged and emailed as follows:
111
113
 
112
114
  at_exit do
@@ -1,22 +1,23 @@
1
1
  module ErrorHandler
2
2
  class EH
3
- EX_OK = 0 ; EX_OK.freeze
4
- EX_BASE = 64; EX_BASE.freeze # base value for error messages
5
- EX_USAGE = 64; EX_USAGE.freeze # command line usage error
6
- EX_DATAERR = 65; EX_DATAERR.freeze # data format error
7
- EX_NOINPUT = 66; EX_NOINPUT.freeze # cannot open input
8
- EX_NOUSER = 67; EX_NOUSER.freeze # addressee unknown
9
- EX_NOHOST = 68; EX_NOHOST.freeze # host name unknown
10
- EX_UNAVAILABLE = 69; EX_UNAVAILABLE.freeze # service unavailable
11
- EX_SOFTWARE = 70; EX_SOFTWARE.freeze # internal software error
12
- EX_OSERR = 71; EX_OSERR.freeze # system error (e.g., can't fork)
13
- EX_OSFILE = 72; EX_OSFILE.freeze # critical OS file missing
14
- EX_CANTCREAT = 73; EX_CANTCREAT.freeze # /* can't create (user) output file
15
- EX_IOERR = 74; EX_IOERR.freeze # input/output error
16
- EX_TEMPFAIL = 75; EX_TEMPFAIL.freeze # temp failure; user is invited to retry
17
- EX_PROTOCOL = 76; EX_PROTOCOL.freeze # remote error in protocol
18
- EX_NOPERM = 77; EX_NOPERM.freeze # permission denied
19
- EX_CONFIG = 78; EX_CONFIG.freeze # configuration error
3
+ EX_OK = 0 unless defined? EX_OK; EX_OK.freeze
4
+ EX_GENERAL = 1 unless defined? EX_GENERAL; EX_GENERAL.freeze
5
+ EX_BASE = 64 unless defined? EX_BASE; EX_BASE.freeze # base value for error messages
6
+ EX_USAGE = 64 unless defined? EX_USAGE; EX_USAGE.freeze # command line usage error
7
+ EX_DATAERR = 65 unless defined? EX_DATAERR; EX_DATAERR.freeze # data format error
8
+ EX_NOINPUT = 66 unless defined? EX_NOINPUT; EX_NOINPUT.freeze # cannot open input
9
+ EX_NOUSER = 67 unless defined? EX_NOUSER; EX_NOUSER.freeze # addressee unknown
10
+ EX_NOHOST = 68 unless defined? EX_NOHOST; EX_NOHOST.freeze # host name unknown
11
+ EX_UNAVAILABLE = 69 unless defined? EX_UNAVAILABLE; EX_UNAVAILABLE.freeze # service unavailable
12
+ EX_SOFTWARE = 70 unless defined? EX_SOFTWARE; EX_SOFTWARE.freeze # internal software error
13
+ EX_OSERR = 71 unless defined? EX_OSERR; EX_OSERR.freeze # system error (e.g., can't fork)
14
+ EX_OSFILE = 72 unless defined? EX_OSFILE; EX_OSFILE.freeze # critical OS file missing
15
+ EX_CANTCREAT = 73 unless defined? EX_CANTCREAT; EX_CANTCREAT.freeze # /* can't create (user) output file
16
+ EX_IOERR = 74 unless defined? EX_IOERR; EX_IOERR.freeze # input/output error
17
+ EX_TEMPFAIL = 75 unless defined? EX_TEMPFAIL; EX_TEMPFAIL.freeze # temp failure; user is invited to retry
18
+ EX_PROTOCOL = 76 unless defined? EX_PROTOCOL; EX_PROTOCOL.freeze # remote error in protocol
19
+ EX_NOPERM = 77 unless defined? EX_NOPERM; EX_NOPERM.freeze # permission denied
20
+ EX_CONFIG = 78 unless defined? EX_CONFIG; EX_CONFIG.freeze # configuration error
20
21
 
21
22
  ERROR = 'error'
22
23
  DEBUG = 'debug'
@@ -1,3 +1,3 @@
1
1
  module ErrorHandler
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eh
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ernst van Graan, Wynand van Dyk
@@ -15,11 +15,12 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-03-20 00:00:00 Z
18
+ date: 2013-04-24 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- prerelease: false
22
21
  name: bundler
22
+ prerelease: false
23
+ type: :development
23
24
  version_requirements: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
@@ -30,11 +31,11 @@ dependencies:
30
31
  - 1
31
32
  - 3
32
33
  version: "1.3"
33
- type: :development
34
34
  requirement: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- prerelease: false
37
36
  name: rake
37
+ prerelease: false
38
+ type: :development
38
39
  version_requirements: &id002 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
@@ -44,11 +45,11 @@ dependencies:
44
45
  segments:
45
46
  - 0
46
47
  version: "0"
47
- type: :development
48
48
  requirement: *id002
49
49
  - !ruby/object:Gem::Dependency
50
- prerelease: false
51
50
  name: rspec
51
+ prerelease: false
52
+ type: :development
52
53
  version_requirements: &id003 !ruby/object:Gem::Requirement
53
54
  none: false
54
55
  requirements:
@@ -58,11 +59,11 @@ dependencies:
58
59
  segments:
59
60
  - 0
60
61
  version: "0"
61
- type: :development
62
62
  requirement: *id003
63
63
  - !ruby/object:Gem::Dependency
64
- prerelease: false
65
64
  name: simplecov
65
+ prerelease: false
66
+ type: :development
66
67
  version_requirements: &id004 !ruby/object:Gem::Requirement
67
68
  none: false
68
69
  requirements:
@@ -72,7 +73,6 @@ dependencies:
72
73
  segments:
73
74
  - 0
74
75
  version: "0"
75
- type: :development
76
76
  requirement: *id004
77
77
  description: Error handler gem that allows wrapping of code blocks with support for block retry, logging, exception filtering and re-raise
78
78
  email: