June 22, 2004

Great example of an awful error message

ERROR util.JDBCExceptionReporter:
    [MYDB]String or binary data would be truncated.

It's not the 'JDBCExceptionReporter' you should care about -- that's from Spring, and Spring has fantastic error messages. It's the 'String or binary data would be truncated". Anyone who has worked with databases for a while has received this message. In human-speak it means: "I'm trying to stuff too much data into a field." -- you've declared a VARCHAR(30) and you're trying to modify the field with a 40-character string, that sort of thing.

BUT WHAT GODDAMNED FIELD IS IT FAILING ON?! The database -- in this case, MS SQL Server 2000 -- must know what field it has the problem with. It must know the max length of allowed data and the length of the string you're trying to add. So why doesn't it say any of these things in the message? (Not to mention: where's the table name?)

Grr grr grr...

Next: Annoying things about Perl
Previous: Thoughts from YAPC