grape
grape copied to clipboard
Added failing spec for nested rescue_from declarations
See: #1975
| 1 Message | |
|---|---|
| :book: | We really appreciate pull requests that demonstrate issues, even without a fix. That said, the next step is to try and fix the failing tests! |
Generated by :no_entry_sign: danger
Doesn't look like it's failing?
Sorry, a bit of a misunderstanding UPD: fixed
Cool, now that we have a spec all we need is a fix! Give it a shot.
@dblock, I have some ideas on how to fix it, but want to discuss due to lack of knowledge.
Somehow we need to use rescue_handler_for_any_class before any other handler, BUT only in case of nested rescue blocks. For now I don't see an obvious solution without stacking all errors (like :rescue_all, :rescue_grape_exceptions etc) to some namespace. Maybe there is any better realization like using reverse_stacking from descendants to the ancestor? Or..?
Feels like maybe the tree of rescue handlers should be traversed as a tree?