Do not prefix error messages with the string "PL/Python: "

It is redundant, given the error context.

Jan Urbański
This commit is contained in:
Peter Eisentraut
2011-01-27 01:00:58 +02:00
parent 582b5ac62e
commit 5829738868
8 changed files with 24 additions and 24 deletions

View File

@ -8,9 +8,9 @@ CREATE FUNCTION sql_syntax_error() RETURNS text
'plpy.execute("syntax error")'
LANGUAGE plpythonu;
SELECT sql_syntax_error();
WARNING: PL/Python: plpy.SPIError: unrecognized error in PLy_spi_execute_query
WARNING: plpy.SPIError: unrecognized error in PLy_spi_execute_query
CONTEXT: PL/Python function "sql_syntax_error"
ERROR: PL/Python: plpy.SPIError: syntax error at or near "syntax"
ERROR: plpy.SPIError: syntax error at or near "syntax"
LINE 1: syntax error
^
QUERY: syntax error
@ -22,7 +22,7 @@ CREATE FUNCTION exception_index_invalid(text) RETURNS text
'return args[1]'
LANGUAGE plpythonu;
SELECT exception_index_invalid('test');
ERROR: PL/Python: IndexError: list index out of range
ERROR: IndexError: list index out of range
CONTEXT: PL/Python function "exception_index_invalid"
/* check handling of nested exceptions
*/
@ -32,9 +32,9 @@ CREATE FUNCTION exception_index_invalid_nested() RETURNS text
return rv[0]'
LANGUAGE plpythonu;
SELECT exception_index_invalid_nested();
WARNING: PL/Python: plpy.SPIError: unrecognized error in PLy_spi_execute_query
WARNING: plpy.SPIError: unrecognized error in PLy_spi_execute_query
CONTEXT: PL/Python function "exception_index_invalid_nested"
ERROR: PL/Python: plpy.SPIError: function test5(unknown) does not exist
ERROR: plpy.SPIError: function test5(unknown) does not exist
LINE 1: SELECT test5('foo')
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
@ -54,9 +54,9 @@ return None
'
LANGUAGE plpythonu;
SELECT invalid_type_uncaught('rick');
WARNING: PL/Python: plpy.SPIError: unrecognized error in PLy_spi_prepare
WARNING: plpy.SPIError: unrecognized error in PLy_spi_prepare
CONTEXT: PL/Python function "invalid_type_uncaught"
ERROR: PL/Python: plpy.SPIError: type "test" does not exist
ERROR: plpy.SPIError: type "test" does not exist
CONTEXT: PL/Python function "invalid_type_uncaught"
/* for what it's worth catch the exception generated by
* the typo, and return None
@ -77,7 +77,7 @@ return None
'
LANGUAGE plpythonu;
SELECT invalid_type_caught('rick');
WARNING: PL/Python: plpy.SPIError: unrecognized error in PLy_spi_prepare
WARNING: plpy.SPIError: unrecognized error in PLy_spi_prepare
CONTEXT: PL/Python function "invalid_type_caught"
NOTICE: type "test" does not exist
CONTEXT: PL/Python function "invalid_type_caught"
@ -104,9 +104,9 @@ return None
'
LANGUAGE plpythonu;
SELECT invalid_type_reraised('rick');
WARNING: PL/Python: plpy.SPIError: unrecognized error in PLy_spi_prepare
WARNING: plpy.SPIError: unrecognized error in PLy_spi_prepare
CONTEXT: PL/Python function "invalid_type_reraised"
ERROR: PL/Python: plpy.Error: type "test" does not exist
ERROR: plpy.Error: type "test" does not exist
CONTEXT: PL/Python function "invalid_type_reraised"
/* no typo no messing about
*/