You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2021/07/26 06:39:03 UTC
[GitHub] [incubator-pegasus] Smityz commented on a change in pull request #790: fix: catch exception if unmarshall the rpc request encounters error
Smityz commented on a change in pull request #790:
URL: https://github.com/apache/incubator-pegasus/pull/790#discussion_r676328718
##########
File path: src/server/pegasus_server_write.cpp
##########
@@ -51,11 +58,20 @@ int pegasus_server_write::on_batched_write_requests(dsn::message_ex **requests,
return _write_svc->empty_put(_decree);
}
- auto iter = _non_batch_write_handlers.find(requests[0]->rpc_code());
- if (iter != _non_batch_write_handlers.end()) {
- dassert_f(count == 1, "count = {}", count);
- return iter->second(requests[0]);
+ try {
Review comment:
Why use `try ... catch ..` rather than `if ... else ...`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org