celluloid/celluloid — pull request #217 by strmpnk (2013-04-17 02:44:17+00:00)
Title: Simplify Call#dispatch exception checks

In order to properly blame the caller rather than the
callee of a method we need to ensure that the exception
raised is actually a side effect of the send itself and
not the code it eventually executes.

Before this patch, a number of checks were used but it
required complicated reflection. To replace this, we just
check the exception trace size against the caller trace
size. It's not cheap but it only executes when there is an
ArgumentError or NoMethodError raised.

This implementation implies that any code that is executed
on the actor side becomes actor failures unless explicitly
wrapped inside Celluloid::AbortError. If a proxy wants to
dynamically raise an exception that implies blame to the
caller, it should use Celluloid::AbortError.

Specs already cover these cases so I've not changed those.