Better exception behavior in RPC code