add expected_exceptions to rpc