patch: clean up exception formatting
| От | Oliver Jowett | 
|---|---|
| Тема | patch: clean up exception formatting | 
| Дата | |
| Msg-id | 20030720044627.GA32403@opencloud.com обсуждение исходный текст  | 
		
| Ответы | 
                	
            		Re: patch: clean up exception formatting
            		
            		 | 
		
| Список | pgsql-jdbc | 
The attached patch (against CVS HEAD) cleans up exception messages in two
areas:
1. Remove PSQLException's override of toString() so that the exception
classname is included in the output of toString() (i.e. the default
Throwable behaviour). Previously a .toString() on a PSQLException produces
something like:
   "Parameter index out of range."
With this patch you get the consistent-with-everything-else result:
  "org.postgresql.util.PSQLException: Parameter index out of range."
2. Strip whitespace from backend-generated errors when using them as an
exception message. Previously, you'd get tracebacks with odd blank lines:
  java.sql.SQLException: ERROR:  parser: parse error at or near "null" at character 27
     at org.postgresql.core.QueryExecutor.executeV2(QueryExecutor.java:286)
     at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:104)
With this patch you get the expected form:
  java.sql.SQLException: ERROR:  parser: parse error at or near "null" at character 27
     at org.postgresql.core.QueryExecutor.executeV2(QueryExecutor.java:286)
     at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:104)
-O
		
	Вложения
В списке pgsql-jdbc по дате отправления: