lib/celluloid/actor_proxy.rb in celluloid-0.2.1 vs lib/celluloid/actor_proxy.rb in celluloid-0.2.2
- old
+ new
@@ -90,15 +90,23 @@
# Otherwise we're inside a normal thread, so block
response = our_mailbox.receive do |msg|
msg.is_a? Response and msg.call == call
end
end
-
+
case response
when SuccessResponse
response.value
when ErrorResponse
- raise response.value
+ ex = response.value
+
+ if ex.is_a? AbortError
+ # Aborts are caused by caller error, so ensure they capture the
+ # caller's backtrace instead of the receiver's
+ raise ex.cause.class.new(ex.cause.message)
+ else
+ raise ex
+ end
else
raise "don't know how to handle #{response.class} messages!"
end
end
end
\ No newline at end of file