Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1ca4e70

Browse files
author
Barry Lind
committed
Applied patch by Oliver Jowett to clean up some exception handling
Modified Files: jdbc/org/postgresql/core/QueryExecutor.java jdbc/org/postgresql/util/PSQLException.java
1 parent d7c609f commit 1ca4e70

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2003, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/core/Attic/QueryExecutor.java,v 1.22 2003/05/29 03:21:32 barry Exp $
9+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/core/Attic/QueryExecutor.java,v 1.23 2003/08/11 21:18:47 barry Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -192,7 +192,7 @@ private BaseResultSet executeV3() throws SQLException
192192

193193
// did we get an error during this query?
194194
if ( errorMessage != null )
195-
throw new SQLException( errorMessage.toString() );
195+
throw new SQLException( errorMessage.toString().trim() );
196196

197197

198198
//if an existing result set was passed in reuse it, else
@@ -283,7 +283,7 @@ private BaseResultSet executeV2() throws SQLException
283283

284284
// did we get an error during this query?
285285
if ( errorMessage != null )
286-
throw new SQLException( errorMessage.toString() );
286+
throw new SQLException( errorMessage.toString().trim() );
287287

288288

289289
//if an existing result set was passed in reuse it, else

src/interfaces/jdbc/org/postgresql/util/PSQLException.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 2003, PostgreSQL Global Development Group
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PSQLException.java,v 1.11 2003/03/14 01:21:47 barry Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PSQLException.java,v 1.12 2003/08/11 21:18:47 barry Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -127,12 +127,4 @@ public String getMessage()
127127
{
128128
return message;
129129
}
130-
131-
/*
132-
* Overides Object
133-
*/
134-
public String toString()
135-
{
136-
return message != null ? message : "";
137-
}
138130
}

0 commit comments

Comments
 (0)