make error types more precise for transaction method#634
Open
mberndt123 wants to merge 4 commits intozio:masterfrom
Open
make error types more precise for transaction method#634mberndt123 wants to merge 4 commits intozio:masterfrom
transaction method#634mberndt123 wants to merge 4 commits intozio:masterfrom
Conversation
360fa02 to
6ef1d92
Compare
6ef1d92 to
0768470
Compare
Author
|
I just noticed that this seems to be the same as #192. So apparently I'm not the only one who wants this. Any chance we can make this happen? |
Collaborator
|
Resolves
|
Author
|
@li-nkSN |
Collaborator
|
@mberndt123 until I work something out regarding having write access to the core ZIO quill module. If you'd like to have a code review and PR. You may make a PR on li-nk zio-protoquill https://www.reddit.com/r/scala/comments/1rnhrea/bastard_quill_protoquilll_now_available/ . I am also available to discuss on the ZIO discord. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I ran into a situation where I needed these more precise error types, so I thought I'd propose them upstream.
I have also noticed that inZioJdbcUnderlyingContext#transaction, if the passed actionffails, the error will always be wrapped inCause.die, even if the rollback succeeds. I think that's a bug and therefore fixed it, and it has the nice additional benefit of getting rid of the<: Throwableconstraint on the error type. But it is arguably an incompatible change of behaviour (like many bug fixes), so I thought I'd point it out.Turns out I actually misread the code here, the error handling was working fine.