Permalink
Browse files

unbreak error propagation spec

  • Loading branch information...
1 parent 04757ef commit 110a3b8c1011d6c05aab148c557c34b02f8b690f @jmettraux jmettraux committed Mar 17, 2013
Showing with 16 additions and 12 deletions.
  1. +5 −0 CHANGELOG.txt
  2. +11 −12 lib/ruote/amqp/receiver.rb
View
@@ -2,6 +2,11 @@
= ruote-amqp
+== ruote-amqp - 2.3.1 not yet released
+
+- passing err['trace'] to Receiver#flunk (Thanks Islam Amer)
+
+
== ruote-amqp - 2.3.0.1 released 2012/09/10
- pin amqp to 0.9.7 and eventmachine to 0.12.10
View
@@ -147,18 +147,17 @@ def flunk(h)
err = h.delete('error')
- args = case err
- when String then [ RemoteError, err ]
- when Hash then [ Ruote.constantize(err['class']), err['message'] ]
- else [ RemoteError, err.inspect ]
- end
-
- if h['trace']
- args << h.delete('trace')
-
- elsif err['trace']
- args << err['trace']
- end
+ args =
+ case err
+ when String
+ [ RemoteError, err ]
+ when Hash
+ as = [ Ruote.constantize(err['class']), err['message'] ]
+ as << err['trace'] if err['trace']
+ as
+ else
+ [ RemoteError, err.inspect ]
+ end
super(h, *args)
end

0 comments on commit 110a3b8

Please sign in to comment.