All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.ennwifi.webframe.codes.CodeException Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package cn.ennwifi.webframe.codes;

/**
 * 代码错误,返回错误代码和说明.
 *
 * @author zhangjianshe
 */
public class CodeException extends Exception {

  /** The code. */
  private Integer code;

    /**
     * Instantiates a new code exception.
     *
     * @param code    the code
     * @param message the message
     */
    public CodeException(Integer code, String message) {
    super(message);
    this.setCode(code);
  }

    /**
     * Instantiates a new code exception.
     *
     * @param errorcode the errorcode
     */
    public CodeException(ErrorCode errorcode) {
    super(errorcode.message);
    this.code = errorcode.code;
  }

    /**
     * Gets the code.
     *
     * @return the code
     */
    public Integer getCode() {
    return code;
  }

    /**
     * Sets the code.
     *
     * @param code the new code
     */
    public void setCode(Integer code) {
    this.code = code;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy