Error handling for pub/sub and rpc messages