Looking through that class, a SYSTEM "rethrow" will produce an XAException with error code 0, but that is not among the defined constants for XAExceptions. So what is that even supposed to mean? It would be cleaner to have overloaded constructors set the error code up front. From the error code, we could tell how the cause should be wrapped, if it weren't for SYSTEM wanting to be an XAException with error code 0. Of course, we can also leave it be, and phase it out sooner rather than later.