sashafrey / topicmod

This project had been moved to https://github.com/bigartm/bigartm
Other
0 stars 0 forks source link

make_rpcz_call() should check distinguish network and application-specific errors #95

Open sashafrey opened 10 years ago

sashafrey commented 10 years ago

make_rpcz_call is a helper located in common.h It makes an rpc call and catches the rpc_error. The issue is that it does not look at error's application-specific error code, which can be retrieved as follows:

} catch(const rpcz::rpc_error& e) { e.get_application_error_code(); e.get_error_message(); }

This is is an application-specific error, than make_rpcz_call must throw application-specific exception (one of those defined in artm/core/exception.h).

sashafrey commented 10 years ago

This can be covered with a unit-test --- just create MasterProxy and issue invalid reconfiguration. We expect a "InvalidOperation" exception, while currently we will get NetworkException.