Skip to content

Exceptions in Rails views are re-raised, losing the original context and making pry-rescue less helpful #89

Open
@yar

Description

@yar

pry-rescue 1.4.2
pry-stack_explorer 0.4.9.2
rails 3.2.21
rspec 3.3.0
rspec-rails 3.3.3

The following occurs in my testing: rails template calls a helper method. The helper method calls a method on my object, and inside it, an exception occurs. The local variables in that object method at the time of the exception are important and I am trying to study them with pry-rescue.

"pry-backtrace" correctly shows my PORO at the very top.

However, "ls" suggests that I am not inside that method, but rather in the scope of the template itself. Local variables of my object are not visible from that context.

I see that Rails tinkers with the original exception, re-raising from a different context, as ActionView::Template::Error.

So this is not really a bug of pry-backtrace, but rather a limitation of its use with Rails. Is there a way to overcome this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions