Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handle SyntaxError in Action View #48957

Merged
merged 1 commit into from Dec 5, 2023
Merged

Better handle SyntaxError in Action View #48957

merged 1 commit into from Dec 5, 2023

Commits on Dec 5, 2023

  1. Addressed an issue where syntax errors generated inside an eval

    method cause an Internal Server Error due to a TypeError.
    
    In order to display the extraced source of a syntax error, we try
    to locate the node id for the backtrace location. The call to
    RubyVM::AbstractSyntaxTree.node_id_for_backtrace_location is expecting
    a Thread::Backtrace::Location object, but we are passing a
    SourceMapLocation instead.
    
    This commit does two things:
    1) it addresses the issue by making sure that we are always passing
    a Thread::Backtrace::Location instead
    2) it allows the development view to show the extracted source fragment
    Mario Caropreso committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    df6d2fb View commit details
    Browse the repository at this point in the history