微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ddd

 

package  org.exception;


/**

 * 订单管理系统的基础错误

 * 

 * 
@author rodney

 * 

 
*/

public   class  OrderBaseException  extends  RuntimeException  {


    

     * 

     
*/

    
private staticfinallong serialVersionUID =-2660698259967334093L;


    
 String errorCode;


    
 String errorMessage;


    
public OrderBaseException() {

        
super();

    }


    

     * 

     * 
@param msg

     * 
 cause

     

    
 OrderBaseException(String msg, Throwable cause) (msg, cause);

    }


    
 msg

     

    
 OrderBaseException(String msg) (msg);

    }


    

    
 OrderBaseException(Throwable cause) (cause);

    }


    

     * 封装错误信息和错误代码

     * 

     * 
 errorCode

     * 

    
 OrderBaseException(String errorCode, String msg) ();

        
this.errorMessage  msg;

        
.errorCode  errorCode;

    }


    

     * 出现异常时,除了封装错误代码错误信息外,还封装了堆栈信息

     * 

     * 

    
(cause);

        


    

     * 
@return 错误代码

     

    
 String getErrorCode() return


    
 errorCode

     *            设置错误代码

     

    
void setErrorCode(String errorCode) 


    
 自定义错误信息

     

    
 String getErrorMessage()  errorMessage;

    }


    
 errorMessage

     *            设置自定义错误信息

     

    
 setErrorMessage(String errorMessage) 

}

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐