Skip to content

make error types more precise for transaction method#634

Open
mberndt123 wants to merge 4 commits intozio:masterfrom
mberndt123:more-precise-transaction-error-types
Open

make error types more precise for transaction method#634
mberndt123 wants to merge 4 commits intozio:masterfrom
mberndt123:more-precise-transaction-error-types

Conversation

@mberndt123
Copy link
Copy Markdown

@mberndt123 mberndt123 commented Jun 18, 2025

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 in ZioJdbcUnderlyingContext#transaction, if the passed action f fails, the error will always be wrapped in Cause.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 <: Throwable constraint 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.

@mberndt123 mberndt123 force-pushed the more-precise-transaction-error-types branch from 360fa02 to 6ef1d92 Compare June 18, 2025 13:02
@mberndt123 mberndt123 force-pushed the more-precise-transaction-error-types branch from 6ef1d92 to 0768470 Compare June 18, 2025 13:25
@mberndt123
Copy link
Copy Markdown
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?

@li-nkSN
Copy link
Copy Markdown
Collaborator

li-nkSN commented Mar 6, 2026

@khajavi

Resolves

@mberndt123
Copy link
Copy Markdown
Author

@li-nkSN
Is there anything I can help with to push this forward?

@li-nkSN
Copy link
Copy Markdown
Collaborator

li-nkSN commented Mar 23, 2026

@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.

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.

2 participants