BuildInErrorMessages.java

  1. package top.infra.localization;

  2. import top.infra.core.ErrorMessage;

  3. /**
  4.  * Created by zhuowan on 2018/3/24 17:12.
  5.  * Description:
  6.  */
  7. @LocalizedMessageBundle(MessageLocale.DEFAULT)
  8. public enum BuildInErrorMessages implements ErrorMessage {

  9.   AUTHENTICATION_FAILED("Authentication failed"), //
  10.   AUTHORIZATION_FAILED("Authorization failed"), //
  11.   ILLEGAL_REQUEST("Parameter error, please check your request whether has illegal parameters"), //
  12.   INVALID_TOKEN("Invalid or expired token"), //
  13.   OK("OK"), //
  14.   RATE_LIMITATION_REACHED("Reached the request rate limitation, please retry later"), //
  15.   SERVER_ERROR("Server error");

  16.   private String text;

  17.   BuildInErrorMessages(final String text) {
  18.     this.text = text;
  19.   }

  20.   @Override
  21.   public String getText() {
  22.     return this.text;
  23.   }

  24.   @Override
  25.   public String getName() {
  26.     return this.name();
  27.   }
  28. }