grape icon indicating copy to clipboard operation
grape copied to clipboard

Added failing spec for nested rescue_from declarations

Open wowinter13 opened this issue 5 years ago • 6 comments

See: #1975

wowinter13 avatar Jan 21 '20 16:01 wowinter13

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

grape-bot avatar Jan 21 '20 16:01 grape-bot

Doesn't look like it's failing?

dblock avatar Jan 21 '20 16:01 dblock

Sorry, a bit of a misunderstanding UPD: fixed

wowinter13 avatar Jan 21 '20 17:01 wowinter13

Cool, now that we have a spec all we need is a fix! Give it a shot.

dblock avatar Jan 21 '20 19:01 dblock

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

wowinter13 avatar Jan 22 '20 09:01 wowinter13

Feels like maybe the tree of rescue handlers should be traversed as a tree?

dblock avatar Jan 22 '20 15:01 dblock