[Webfunds-commits] java/webfunds/sox Errors.java Reply.java Request.java

Ian Grigg iang@cypherpunks.ai
Sat, 10 Jun 2000 14:31:33 -0400 (AST)


iang        00/06/10 14:31:33

  Modified:    webfunds/sox Errors.java Reply.java Request.java
  Log:
  changed the error logic around, and got rid of the default error text in reply,
  as it has no way to interpret usefully non-SOX optional request errors.

Revision  Changes    Path
1.13      +4 -5      java/webfunds/sox/Errors.java

Index: Errors.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Errors.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Errors.java	2000/03/11 22:35:15	1.12
+++ Errors.java	2000/06/10 18:31:32	1.13
@@ -1,5 +1,5 @@
 /*
- * $Id: Errors.java,v 1.12 2000/03/11 22:35:15 iang Exp $
+ * $Id: Errors.java,v 1.13 2000/06/10 18:31:32 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -148,10 +148,9 @@
      */
     public static final String errorString(int errno)
     {
-         if (errno < 0 || errno >= errors.length)
-         {
-             return "unknown error";
-         }
+         if ( ! (0 <= errno && errno < errors.length) )
+             return "unknown SOX error";
+
          return errors[errno];
     }
     



1.15      +2 -2      java/webfunds/sox/Reply.java

Index: Reply.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Reply.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Reply.java	2000/03/22 08:51:28	1.14
+++ Reply.java	2000/06/10 18:31:32	1.15
@@ -1,5 +1,5 @@
 /*
- * $Id: Reply.java,v 1.14 2000/03/22 08:51:28 iang Exp $
+ * $Id: Reply.java,v 1.15 2000/06/10 18:31:32 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -82,7 +82,7 @@
     {
         this.requestId = requestId;
         this.errorNumber = errNum;
-        this.errorText = Errors.errorString(errNum);
+        //this.errorText = Errors.errorString(errNum);
     }
   
     /**



1.16      +2 -2      java/webfunds/sox/Request.java

Index: Request.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Request.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Request.java	2000/03/11 22:37:49	1.15
+++ Request.java	2000/06/10 18:31:32	1.16
@@ -1,5 +1,5 @@
 /*
- * $Id: Request.java,v 1.15 2000/03/11 22:37:49 iang Exp $
+ * $Id: Request.java,v 1.16 2000/06/10 18:31:32 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -275,7 +275,7 @@
         account = new AccountId(dis);
         timestamp = dis.readLong();
         sig = readByteArray(dis);
-        if (sig.length == 0)
+        if (sig != null && (sig.length == 0))
             sig = null;
     }