Halt with mutable backtrace - #116
Conversation
Exceptions are typically raised with mutable backtraces. This fixes an issue with spring where all backtraces are sanitized to remove spring references.
|
I can counter that with typically libraries don't patch the kernel methods, eh? Anyway, thank you for working on this. Do you think we could reuse the same mutable array for all backtraces? I hope rails doesn't add lines to them? |
|
🤚Hey, no problem. 🤚I'm just trying to clarify intent in the commit message -- not be argumentative. I get that dry-monads is just one half of this incompatibility, and I agree that patching Kernel is a bold move. I opened tickets on both projects. You responded and they haven't, so I just wanted to assist by opening this PR. I appreciate your work.
I probably would not share the empty backtrace arrays knowing what we know, but I can tell you are being careful with allocations. To my knowledge Rails doesn't add stuff to backtraces, but we've been surprised once already :) Side note: is this use-case ripe for throw/catch, since this Halt exception is part of routine function and not bound for the outside world? 🤷🏻♂️
EDIT: Nevermind, I see this now: #98 (comment) |
|
Sure, my reply wasn't personal at all. It's like rails never cease to wonder.
Right, let's just ship it. I'll push a release tomorrow.
It's local and it can be done with a simple return statement. However, the goal is to make transaction blocks in do notation aware of interruption, see https://dry-rb.org/gems/dry-monads/1.0/do-notation/#transaction-safety |
|
Thank you! |
Exceptions are typically raised with mutable backtraces. This fixes an
issue with spring where all backtraces are sanitized to remove spring
references. #115