package org.holer.server.model;

import org.holer.server.constant.HolerCode;
import org.holer.server.util.ServerUtil;


public class HolerException
        extends RuntimeException {
    private static final long serialVersionUID = -5954389116188667728L;
    private HolerStatus status;

    public HolerException(HolerCode hc) {
        this.status = ServerUtil.status(hc.value());
    }


    public Integer getCode() {
        if (null == this.status) {
            return 0;
        }
        return this.status.getCode();
    }


    public String getMessage() {
        if (null == this.status) {
            return "";
        }
        return this.status.getMsg();
    }
}
