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:
Marc Prud'hommeaux 2007-03-24 19:37:32 +00:00
parent ae2d8685e1
commit 91cc432676
1 changed files with 10 additions and 3 deletions

View File

@ -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());