7 ms·
This is sort of what HTTP codes get at though. The server doesn't know what you want to do with a 400 but it knows that the problem is with the request for exa
by pythonaut_16 4y ago
This is sort of what HTTP codes get at though.
The server doesn't know what you want to do with a 400 but it knows that the problem is with the request for example.
- deleted 4y ago[deleted]
- PaulHoule 4y agoActually there is somewhat standardized set of SQL error codes and they can be put into a hierarchy like the HTTP codes. For instance, you can have a SQL error because the syntax of your SQL is wrong. If you're not doing "dynamic SQL" you know this is a programming error (it doesn't matter what input was supplied to the functions.) One common error is "attempted to insert a row with a duplicate key", frequently you want to catch that SQLException and rethrow all the rest. The ideal SQL library for Java would expose the hierarchy implicit in SQL errors as a class hierarchy.