You should document any and all exceptions that a member function throws at you so that other programmers know what their code will need to catch.
您应该对成员函数向您掷出的所有异常编制文档,以便其它程序员知道他们的代码将需要捕捉什么。
It is still advisable that you catch all exceptions and handle them appropriately, as shown in the following code.
如下面的代码所示,发现所有的异常并正确的处理他们仍是明智之举。
Another healthy practice is to catch all exceptions and fall back to reporting UNKNOWN service status so that Nagios can manage notification of this fact appropriately.
另一个好的实践是捕获所有的异常,并后退以报告unknown服务状态,以便Nagios能够正确地管理有关这个情况的通知。
This way you can find the unexpected exceptions during the testing phase and address them in some manner more appropriate than a catch for all exception types.
这个方法在测试以及定位这些异常的时候,您可以找到这些意外的异常,总比接收所有异常类型要更加合适。
This way you can find the unexpected exceptions during the testing phase and address them in some manner more appropriate than a catch for all exception types.
这个方法在测试以及定位这些异常的时候,您可以找到这些意外的异常,总比接收所有异常类型要更加合适。
应用推荐