Best way to define error codes/strings in Java?

前端 未结 13 761
别那么骄傲
别那么骄傲 2020-12-12 08:37

I am writing a web service in Java, and I am trying to figure out the best way to define error codes and their associated error strings. I need to have a nu

相关标签:
13条回答
  • 2020-12-12 09:29

    enum for error code/message definition is still a nice solution though it has a i18n concerns. Actually we may have two situations: the code/message is displayed to the end user or to the system integrator. For the later case, I18N is not necessary. I think the web services is most likely the later case.

    0 讨论(0)
提交回复
热议问题