Revision: 3127
          http://vexi.svn.sourceforge.net/vexi/?rev=3127&view=rev
Author:   mkpg2
Date:     2008-10-17 20:58:32 +0000 (Fri, 17 Oct 2008)

Log Message:
-----------
Development
  - save path in file in project (so it is checked into VC)
  - improved vexi navigator

Added Paths:
-----------
    trunk/tools/org.vexi.vexidev/src/tim/api/
    trunk/tools/org.vexi.vexidev/src/tim/api/Error.java
    trunk/tools/org.vexi.vexidev/src/tim/api/Exn.java

Added: trunk/tools/org.vexi.vexidev/src/tim/api/Error.java
===================================================================
--- trunk/tools/org.vexi.vexidev/src/tim/api/Error.java                         
(rev 0)
+++ trunk/tools/org.vexi.vexidev/src/tim/api/Error.java 2008-10-17 20:58:32 UTC 
(rev 3127)
@@ -0,0 +1,47 @@
+package tim.api;
+
+
+public class Error {
+       
+       /** System is incoherrent (this is usually serious) */
+       public static class BadSystemData extends java.lang.Error{
+           public BadSystemData(String message){ super(message); }
+           public BadSystemData(String message, Throwable cause){ 
super(message, cause); }
+       }
+
+       public static class Problem extends java.lang.Error{
+           public Problem(String message){ super(message); }
+           public Problem(String message, Throwable cause){ super(message, 
cause); }
+       }
+       
+       public static class BrokenModule extends java.lang.Error{
+               public BrokenModule(String modulename, String message) {
+               super("Problem with module '"+modulename+"'\n"+message);
+               }
+
+               public BrokenModule(String modulename, Exception e) {
+                        super("Problem with module '"+modulename+"'",e);
+               }
+       }
+       
+       
+       /** Of course all errors should not happen. This is when something can 
be locally verified
+        * as impossible and then will only happen if there is an easily 
correctable local mistake.*/
+       public static class ShouldNotHappen extends java.lang.Error{
+        public ShouldNotHappen() {
+            super("Problem, this should not be possible");
+        }
+
+               public ShouldNotHappen(String message) {
+                       super(message);
+               }
+
+               public ShouldNotHappen(String message, Throwable t) {
+                       super(message,t);
+               }
+
+               public ShouldNotHappen(Throwable t) {
+                       super(t);
+               }
+       }
+}


Property changes on: trunk/tools/org.vexi.vexidev/src/tim/api/Error.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/tools/org.vexi.vexidev/src/tim/api/Exn.java
===================================================================
--- trunk/tools/org.vexi.vexidev/src/tim/api/Exn.java                           
(rev 0)
+++ trunk/tools/org.vexi.vexidev/src/tim/api/Exn.java   2008-10-17 20:58:32 UTC 
(rev 3127)
@@ -0,0 +1,114 @@
+package tim.api;
+
+// REMARK possibly these should be here as they are typed,
+// We should consider runtime/dynamic typing with a property
+// identifying the type of the exception.
+
+public class Exn extends Exception{
+
+       Exn(){}
+       public Exn(Throwable cause) {
+               super(cause);
+       }
+       public Exn(String message) {
+               super(message);
+       }
+       public Exn(String message, Throwable cause) {
+               super(message, cause);
+       }
+       
+       /** Operation yet implemented, but may be allowed in the future */
+       public static class Unsupported extends java.lang.RuntimeException{
+           public Unsupported(String message) {
+               super(message);
+           }
+
+               public Unsupported() { super("Unsupported operation"); }
+       }
+       
+       /* * Problem with the request, no data, etc.
+       public static class Request extends Prepending{
+        public Request(String message) {
+            super(message);
+        }
+               public Request(String message, Exception e) {
+                       super(message,e);
+               }
+               public Request(Exception e) {
+                       super("",e);
+               }
+    }*/
+
+       /** User data incoherrent (Compare to Error.Coherency which is when
+        * system data is incoherrent which should not happen) */
+       /*
+       public static class BadUserData extends Prepending{
+        public BadUserData(String message) {
+            super(message);
+        }
+    }
+       
+       
+    public static class Forbidden extends Exn{
+               public Forbidden(String message){
+                       super(message);
+               }
+       }
+       
+       public static class InsufficientRights extends Forbidden{
+        public InsufficientRights(String message) {
+            super(message);
+        }
+       }*/
+       
+
+
+       /** Operation would violate a constraint */
+       /*
+       public static class Constraint extends Exn{
+           public Constraint(String message){
+               super(message);
+           }
+       }*/
+
+       static public abstract class Prepending extends Exn{
+               String message;
+        public Prepending(String message){
+            this.message = message;
+        }
+               public Prepending(String message, Exception cause){
+            super(cause);
+            this.message = message;
+        }
+        
+        public void prepend(String s) {
+               message = s + message;
+        }
+        
+        public String getMessage() {
+               return message;
+        }
+       }
+       /*
+       public static class Validation extends Prepending{
+               
+        public Validation(String message){
+            super(message);
+        }
+        public Validation(int expected, int actual, String what) {
+            this("Expected '" + expected + "',  Got '" + actual+"' " + what);
+        }
+        public Validation(String expected, String actual) {
+            this("Expected '" + expected + "'\n"+
+                "Got      '" + actual+"'");
+        }
+        public Validation(String expected, Class actual) {
+            this("Expected '" + expected + "',  Got '" + 
actual.getSimpleName()+"'");
+        }
+        
+        public Validation(String message, Exception cause){
+            super(message,cause);
+        }
+    }*/
+
+}


Property changes on: trunk/tools/org.vexi.vexidev/src/tim/api/Exn.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to