rpc: changed error handling