How are errors handled in ICU?
Since not all compilers can handle exceptions, we return an error from functions with a UErrorCode parameter. The UErrorCode parameter of a function will return any errors that occurred while it was executing. It’s usually a good idea to check for errors after calling a function by using the U_SUCCESS and U_FAILURE macros. U_SUCCESS returns true when the function did run properly, and U_FAILURE returns true when the function did NOT run properly. You may handle specific errors from a function by checking the exact value of error. The possible values of UErrorCode are located in utypes.h of the common project. Before any function is called with a UErrorCode, it must be initialized to U_ZERO_ERROR. Here is an example of UErrorCode being used.