mirror of https://github.com/apache/openjpa.git
OPENJPA-176 Made the stringified exception prefixes scrutable.
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@522097 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ae2d8685e1
commit
91cc432676
|
@ -132,10 +132,17 @@ public class Exceptions {
|
|||
* Stringify the given exception.
|
||||
*/
|
||||
public static String toString(ExceptionInfo e) {
|
||||
int type = e.getType();
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append("<").append(e.getType()).
|
||||
append('|').append(e.isFatal()).
|
||||
append('|').append(OpenJPAVersion.VERSION_NUMBER).
|
||||
buf.append("<").
|
||||
append(OpenJPAVersion.VERSION_NUMBER).append(' ').
|
||||
append(e.isFatal() ? "fatal " : "nonfatal ").
|
||||
append (type == ExceptionInfo.GENERAL ? "general error" :
|
||||
type == ExceptionInfo.INTERNAL ? "internal error" :
|
||||
type == ExceptionInfo.STORE ? "store error" :
|
||||
type == ExceptionInfo.UNSUPPORTED ? "unsupported error" :
|
||||
type == ExceptionInfo.USER ? "user error" :
|
||||
(type + " error")).
|
||||
append("> ");
|
||||
buf.append(e.getClass().getName()).append(": ").
|
||||
append(e.getMessage());
|
||||
|
|
Loading…
Reference in New Issue