Skip to content
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

Add entity name to RowCountException #761

Merged

Conversation

0xnm
Copy link
Contributor

@0xnm 0xnm commented Mar 14, 2018

I see RowCountException sometimes in the Crashlytics logs, but its message doesn't say which entity failed (and there is no root SQLException, which would say this), so the goal of this PR is to add failed entity name to the exception message.

I also didn't fine any way to test throwing this exception, do you have any advice on that?

@CLAassistant
Copy link

CLAassistant commented Mar 14, 2018

CLA assistant check
All committers have signed the CLA.

private final long expected;
private final long actual;

RowCountException(long expected, long actual) {
super("Expected " + expected + " row affected actual " + actual);
RowCountException(String entityName, long expected, long actual) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the usage it would be simpler if this argument was a Class instead of a String. That would simplify the usage in all the calling sites

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the point, updated PR.

@npurushe npurushe merged commit 1bc0717 into requery:master Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants