openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r522097 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java
Date Sat, 24 Mar 2007 19:37:32 GMT
Author: mprudhom
Date: Sat Mar 24 12:37:32 2007
New Revision: 522097

URL: http://svn.apache.org/viewvc?view=rev&rev=522097
Log:
OPENJPA-176 Made the stringified exception prefixes scrutable.

Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java?view=diff&rev=522097&r1=522096&r2=522097
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java
Sat Mar 24 12:37:32 2007
@@ -132,10 +132,17 @@
      * 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());



Mime
View raw message