ElmerFudd 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a3de2637948d13b9c64068162b9421ad00dff8d
4
- data.tar.gz: 7013365401c3d7ec217cef3320f71c5bc9cc5506
3
+ metadata.gz: bc8da26705616620eae01fffbc82e760c13253d7
4
+ data.tar.gz: 855f6e8f65dd9f54ca44d30ac28fb5bcd53f37be
5
5
  SHA512:
6
- metadata.gz: a06ef29aa8f6cf38376667fe1c67ec8344dcb43d2abeee3c047e08a7e91988757046bba1bee373f825661adc78164613c21ad26a5e8f8f1b3d56ad7ebdaca0d1
7
- data.tar.gz: 9731251c20b45b051863c7af619d31c8ca4e68bb5ea8a628207e8fd99b655a0178d7c7a1d1c42f76bbd8ed6cb9f047643030f68255011a21309770fcb35505d6
6
+ metadata.gz: 176046832909f4f3fcabf985ce5fde5db93ec597a646ed1b81714526b761101e55c0602be5077600110b8b17d33f50f56527435bff9e8f4d88ff95e4fc120a41
7
+ data.tar.gz: 1616f43d34a640be58e652b62c2f7bf9975c9db91a278efe3dd1b82cce315e1f55c6166c0756f1b402218cd98bfd0b582038cfd3ec55c4bd310c52d7dddef3e3
data/lib/ElmerFudd.rb CHANGED
@@ -177,13 +177,28 @@ module ElmerFudd
177
177
  end
178
178
 
179
179
  class DropFailedFilter
180
- extend Filter
180
+ include Filter
181
+
181
182
  def self.call(env, message, filters)
183
+ new.call(env, message, filters)
184
+ end
185
+
186
+ def initialize(exception: Exception,
187
+ exception_message_matches: /.*/)
188
+ @exception = exception
189
+ @exception_message_matches = exception_message_matches
190
+ end
191
+
192
+ def call(env, message, filters)
182
193
  call_next(env, message, filters)
183
- rescue Exception => e
184
- env.logger.info "Ignoring failed payload: #{message.payload}"
185
- env.logger.debug "#{e.class}: #{e.message}"
186
- e.backtrace.each { |l| env.logger.debug(l) }
194
+ rescue @exception => e
195
+ if e.message =~ @exception_message_matches
196
+ env.logger.info "Ignoring failed payload: #{message.payload}"
197
+ env.logger.debug "#{e.class}: #{e.message}"
198
+ e.backtrace.each { |l| env.logger.debug(l) }
199
+ else
200
+ raise
201
+ end
187
202
  end
188
203
  end
189
204
 
@@ -1,3 +1,3 @@
1
1
  module ElmerFudd
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ElmerFudd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrzej Sliwa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-16 00:00:00.000000000 Z
12
+ date: 2014-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bunny