📄 storageexception.java
字号:
/** * */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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -