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

Use Exception#detailed_message to show backtrace #1952

Merged
merged 2 commits into from Oct 18, 2023

Conversation

mame
Copy link
Contributor

@mame mame commented Oct 13, 2023

Before:

Use Ctrl-C to stop
2023-10-13 18:49:17 - NoMethodError - undefined method `time' for 1:Integer:
        test.rb:4:in `block in <main>'
        /home/mame/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.1.0/lib/sinatra/base.rb:1775:in `call'

After:

Use Ctrl-C to stop
2023-10-13 18:49:17 - NoMethodError - undefined method `time' for 1:Integer:

          1.time {}
           ^^^^^
        Did you mean?  times
        test.rb:4:in `block in <main>'
        /home/mame/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.1.0/lib/sinatra/base.rb:1775:in `call'

What do you think?

Before:

```
Use Ctrl-C to stop
        test.rb:4:in `block in <main>'
        /home/mame/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.1.0/lib/sinatra/base.rb:1775:in `call'
```

After:

```
Use Ctrl-C to stop
2023-10-13 18:49:17 - NoMethodError - undefined method `time' for 1:Integer:

          1.time {}
           ^^^^^
        Did you mean?  times
        test.rb:4:in `block in <main>'
        /home/mame/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sinatra-3.1.0/lib/sinatra/base.rb:1775:in `call'
```
lib/sinatra/base.rb Outdated Show resolved Hide resolved
lib/sinatra/base.rb Outdated Show resolved Hide resolved
@dentarg
Copy link
Member

dentarg commented Oct 13, 2023

What do you think?

I like it 👍

Co-authored-by: Patrik Ragnarsson <patrik@starkast.net>
@mame
Copy link
Contributor Author

mame commented Oct 13, 2023

What do you think?

I like it 👍

Thanks! I have merged your suggestion.

@dentarg dentarg merged commit d011cc4 into sinatra:main Oct 18, 2023
14 checks passed
@dentarg dentarg mentioned this pull request Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants