New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify what should happen if Row.get(…) is called with a negative/out of bounds index/non-existing column name #184
Comments
|
After discussing the ticket in the monthly call, we want to do something about this. The design choices range from a |
|
I just wanted to make sure I did not mislead in the meeting -- I think |
|
All good, these are all valid options. |
|
I agree that IllegalArgumentException seems like the best choice, as it is one of the exception types listed in section 11 of the 0.8.x specification. Drivers should follow the spec. When invoking Row.get(...) with an invalid index or name, IllegalArgumentException seems more descriptive than IllegalStateException or UnsupportedOperationException. R2dbcException would signify a failed database interaction, so is not applicable here. |
Well, the JDBC precedent is |
|
The problem with JDBC is that everything is an |
Same as here, given your initial issue text? 😀 |
|
Right now, the error behavior isn't specified so everyone is doing something different and now we have the chance to clean up things and actually put them into the TCK to help implementors convince towards the spec. |
|
We make already use of |
…fication. We now throw the correct exception type according to the spec. [resolves #456][r2dbc/r2dbc-spi#184] Signed-off-by: Mark Paluch <mpaluch@vmware.com>
Right now, we're lacking a specification for
Row.get(…)what should happen if the column index is out of bounds (negative, greater than the number of available columns) or a column name is used that isn't present in the result.Analyzing the drivers yields the following behavior:
This ticket is to discuss the options and to agree on how implementations of
Row.get(…)should behave.The text was updated successfully, but these errors were encountered: