package com.xynet.pay.Exception; /** * 业务异常 * * @author yangsj */ public class BusinessException extends RuntimeException { private static final long serialVersionUID = 5808616192752024016L; private String code; private Object[] args; public BusinessException() { } public BusinessException(String code, String msg) { super(msg); this.code = code; } public BusinessException(String code, String msg, Object[] _args) { super(msg); this.code = code; this.args = _args; } public BusinessException(Throwable exception) { super(exception); getExceptionCode(exception); } private void getExceptionCode(Throwable exception) { if ((exception instanceof BusinessException)) { this.code = ((BusinessException)exception).getCode(); } else { this.code = "999999"; } } public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public Object[] getArgs() { return this.args; } public void setArgs(Object[] args) { this.args = args; } }