db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1037716 - in /db/derby/code/trunk/java: client/org/apache/derby/client/net/Request.java engine/org/apache/derby/loc/messages.xml shared/org/apache/derby/shared/common/reference/SQLState.java
Date Mon, 22 Nov 2010 13:43:10 GMT
Author: rhillegas
Date: Mon Nov 22 13:43:10 2010
New Revision: 1037716

URL: http://svn.apache.org/viewvc?rev=1037716&view=rev
Log:
DERBY-4315: Clean up error reporting when sending an InputStream from the client to the server.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java?rev=1037716&r1=1037715&r2=1037716&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java Mon Nov 22 13:43:10
2010
@@ -317,14 +317,14 @@ public class Request {
 			do {
 				try {
 					bytesRead = in.read(bytes_, offset_, bytesToRead);
-				} catch (java.io.IOException e) {
+				} catch (Exception e) {
                     status = DRDAConstants.STREAM_READ_ERROR;
                     padScalarStreamForError(leftToRead, bytesToRead,
                             writeEXTDTAStatusByte, status);
 					// set with SQLSTATE 01004: The value of a string was truncated when assigned to a host
variable.
 					netAgent_.accumulateReadException(new SqlException(
 																	   netAgent_.logWriter_,
-																	   new ClientMessageId(SQLState.NET_IOEXCEPTION_ON_READ),
+																	   new ClientMessageId(SQLState.NET_EXCEPTION_ON_READ),
 																	   new Integer(parameterIndex),
 																	   e.getMessage(),
 																	   e));
@@ -359,12 +359,12 @@ public class Request {
 																   new ClientMessageId(SQLState.NET_INPUTSTREAM_LENGTH_TOO_SMALL),
 																   new Integer(parameterIndex)));
 			}
-		} catch (java.io.IOException e) {
+		} catch (Exception e) {
             status = DRDAConstants.STREAM_READ_ERROR;
 			netAgent_.accumulateReadException(new SqlException(
 															   netAgent_.logWriter_,
 															   new ClientMessageId(
-																				   SQLState.NET_IOEXCEPTION_ON_STREAMLEN_VERIFICATION),
+																				   SQLState.NET_EXCEPTION_ON_STREAMLEN_VERIFICATION),
 															   new Integer(parameterIndex),
 															   e.getMessage(),
 															   e));
@@ -463,13 +463,13 @@ public class Request {
                 }
                 
             }
-        } catch (java.io.IOException e) {
+        } catch (Exception e) {
             if (writeEXTDTAStatusByte) {
                 writeEXTDTAStatus(DRDAConstants.STREAM_READ_ERROR);
             }
             final SqlException sqlex = 
                 new SqlException(netAgent_.logWriter_,
-                                 new ClientMessageId(SQLState.NET_IOEXCEPTION_ON_READ),
+                                 new ClientMessageId(SQLState.NET_EXCEPTION_ON_READ),
                                  new Integer(parameterIndex),
                                  e.getMessage(),
                                  e);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml?rev=1037716&r1=1037715&r2=1037716&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml Mon Nov 22 13:43:10
2010
@@ -4986,7 +4986,7 @@ ln=lower-case two-letter ISO-639 languag
 
             <msg>
                 <name>XN014.S</name>
-                <text>Network protocol error: encountered an IOException, parameter
#{0}.  Remaining data has been padded with 0x0. Message: {1}.</text>
+                <text>Encountered an Exception while reading from the stream specified
by parameter #{0}.  The remaining data expected by the server has been filled with 0x0. The
Exception had this message: {1}.</text>
                 <arg>value</arg>
                 <arg>messageText</arg>
             </msg>
@@ -4999,7 +4999,7 @@ ln=lower-case two-letter ISO-639 languag
 
             <msg>
                 <name>XN016.S</name>
-                <text>Network protocol error: encountered error in stream length verification,
parameter #{0}.  Message: {1}.</text>
+                <text>Encountered an Exception while trying to verify the length of
the stream specified by parameter #{0}.  The Exception had this message: {1}.</text>
                 <arg>value</arg>
                 <arg>messageText</arg>
             </msg>

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=1037716&r1=1037715&r2=1037716&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Mon Nov 22 13:43:10 2010
@@ -1603,9 +1603,9 @@ public interface SQLState {
     String NET_PROCEDURE_NAME_LENGTH_OUT_OF_RANGE                   = "XN011.S";
     String NET_WRONG_XA_VERSION                                     = "XN012.S";
     String NET_INVALID_SCROLL_ORIENTATION                           = "XN013.S";
-    String NET_IOEXCEPTION_ON_READ                                  = "XN014.S";
+    String NET_EXCEPTION_ON_READ                                  = "XN014.S";
     String NET_INPUTSTREAM_LENGTH_TOO_SMALL                         = "XN015.S";
-    String NET_IOEXCEPTION_ON_STREAMLEN_VERIFICATION                = "XN016.S";
+    String NET_EXCEPTION_ON_STREAMLEN_VERIFICATION                = "XN016.S";
     String NET_PREMATURE_EOS                                        = "XN017.S";
     String NET_READER_LENGTH_TOO_SMALL                              = "XN018.S";
     String NET_XARETVAL_ERROR                                       = "XN019.S";



Mime
View raw message