This is the normal way to test for errors. The C library has two macros "U_SUCCESS" and "U_FAILURE" that is used to check error codes. The "U_FAILURE" macro basically checks if the error code is greater than zero, which is what I have done here. We don't have any method like the C macros to check the error code.