Topic: To count with an error or to produce the error report?
Let's admit, you need to count the total on all accounts. Also there was a situation when the total on one of accounts is not installed (i.e. API does not return value of the total generally) though according to the interaction protocol such situation is eliminated. A choice: 1. Or to display the error report, to tell that on one of accounts the total it is not installed. But then even the approximate information at the user will not be. Can to it there will be a helpful information that there at least 1 million rbl. is, let at all it was not possible to consider all accounts. 2. the total on accounts which are accessible, and there where protocol violation - . But then the user can be misled, after all some accounts it was not possible. 3. To produce the message that was possible 100 accounts from 112, to produce that it turned out and to produce what accounts it was not possible to consider in view of a server error. Or other example. You need to count the amount of the goods accessible in all shops of your competitors. At each shop the API, independent. And at attempt to receive kol-in the goods, 3 shops from 100 returned an error. What to do? Not to display at all the information or what returned an error and the available data? Whether you faced similar systems, as usual solve these problems (a problem of incompleteness of the data, whether that)? And the question connected to it. What mechanism for information transfer about the collected errors is better for using? After all the exception (Exception) does not quit, it breaks execution process. Then return codes? More truly the list return code + the message?