storageexception.java

来自「Local Lucene ==================== Prov」· Java 代码 · 共 65 行

JAVA
65
字号
/** *  */package com.pjaol.ifodder.storage;/** * @author pjaol *  */public class StorageException extends Throwable{	/**	 * 	 */	private static final long serialVersionUID = 1L;	private int id; // a unique id	private String classname; // the name of the class	private String method; // the name of the method	private String message; // a detailed message	private StorageException previous = null; // the exception which was												// caught	private String separator = "\n"; // line separator	public StorageException(int id, String classname, String method,			String message, StorageException previous) {		this.id = id;		this.classname = classname;		this.method = method;		this.message = message;		this.previous = previous;	}	public String traceBack() {		return traceBack("\n");	}	public String traceBack(String sep) {		this.separator = sep;		int level = 0;		StorageException e = this;		String text = line("Calling sequence (top to bottom)");		while (e != null) {			level++;			text += line("--level " + level					+ "--------------------------------------");			text += line("Class/Method: " + e.classname + "/" + e.method);			text += line("Id          : " + e.id);			text += line("Message     : " + e.message);			e = e.previous;		}		return text;	}	private String line(String s) {		return s + separator;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?