If the enumeration class can be inherited, it can solve the problem of error code expansion very well, because the parent or upper level application design only contains simple, basic or public error codes, and the lower level application needs to expand a lot of error codes in the face of actual application situations.
Can abstract classes have static abstract methods? Then you can have a good specification for its subclasses.