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
Revise document for handling exceptions #932
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a few comments and suggestions. PTAL!
docs/api-guide.md
Outdated
If you catch `UnknownTransactionStatusException`, you are not sure if the transaction succeeds or not. | ||
If you catch `CommitException`, it indicates that committing the transaction fails due to transient or nontransient faults. You can try retrying the transaction from the beginning, but the transaction may still fail if the cause is nontranient. | ||
If you catch `CommitConflictException`, it indicates that committing the transaction fails due to transient faults (e.g., a conflict error). You can retry the transaction from the beginning. | ||
If you catch `UnknownTransactionStatusException`, it indicates that you are not sure if the transaction succeeds or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you catch `UnknownTransactionStatusException`, it indicates that you are not sure if the transaction succeeds or not. | |
If you catch `UnknownTransactionStatusException`, it indicates that you are not sure if the transaction succeeds or not. |
Although I edited the above sentence a bit, it is a bit unclear to me. Should it indicates that you are not sure if the transaction succeeds or not
be something like it indicates that the status of the transaction, whether it has succeeded or not, is unknown
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Thank you! Fixed in 0b33081.
Co-authored-by: Josh Wong <joshua.wong@scalar-labs.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!🙇♂️
try { | ||
tx.rollback(); | ||
transaction.rollback(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[trivial] I guess those who read the error handling for rollback
might wonder why just logging is okay. Maybe describing the reason that the failures of rollback
can be ignored would be helpful for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I have added some more explanation in ad4828e. Please take a look when you have time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
This PR revises the document for handling exceptions. Please take a look!