标签:
package cn.edu.hbcf.common.vo; import java.io.PrintWriter; import java.io.StringWriter; /** * Ext 异常返回对象 * * @author LiPenghui */ public class ExceptionReturn { /** * 是否成功 */ private boolean success; /** * 异常消息 */ private Object exceptionMessage; public ExceptionReturn() { } /** * 异常时的构造方法 * * @param msg * 异常消息 */ public ExceptionReturn(Throwable exceptionMessage) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); exceptionMessage.printStackTrace(pw); // 异常情况 this.success = false; this.exceptionMessage = exceptionMessage.getMessage(); } public boolean isSuccess() { return success; } public void setSuccess(boolean success) { this.success = success; } public Object getExceptionMessage() { return exceptionMessage; } public void setExceptionMessage(Object exceptionMessage) { this.exceptionMessage = exceptionMessage; } }
标签:
原文地址:http://www.cnblogs.com/zrui-xyu/p/4942834.html