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

Fix exception name #764

Merged
merged 1 commit into from
Nov 12, 2024
Merged

Conversation

m-bucher
Copy link
Contributor

Not sure if this requires opening an issue 😁

@adamruzicka
Copy link
Contributor

Hrmm, it has been there for ages, has it stopped working?

@m-bucher
Copy link
Contributor Author

I guess you do not really see the difference, because if this is hit then you get an exception, just not the one that is expected, but a NameError:

home/vagrant/foreman/.vendor/ruby/3.0.0/gems/dynflow-1.9.0/lib/dynflow/dispatcher/client_dispatcher.rb:258:in `with_ping_request_caching'
/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/dynflow-1.9.0/lib/dynflow/dispatcher/client_dispatcher.rb:116:in `publish_request'
[ concurrent-ruby ]
rake aborted!
NameError: uninitialized constant ForemanTasks::TimeoutError
/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/foreman-tasks-10.0.1/lib/foreman_tasks.rb:36:in `block (2 levels) in trigger_task'
/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/algebrick-0.7.5/lib/algebrick/matchers/abstract.rb:74:in `assigns'
/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/algebrick-0.7.5/lib/algebrick/matching.rb:56:in `match_value'
/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/algebrick-0.7.5/lib/algebrick/matching.rb:36:in `block in match?'
/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/algebrick-0.7.5/lib/algebrick/matching.rb:35:in `each'

It might also be that this error is not encountered that often. In my case it was some weird problem in my forklift dev-environment 😅

The only way this would really show is if you explicitly tried to rescue this specific exception 🤔

@adamruzicka
Copy link
Contributor

adamruzicka commented Nov 12, 2024

Oh, I think I see it. Are you on ruby >=3.1? TimeoutError seems to have been removed[1] in timeout-0.2.0 which is shipped with ruby-3.1

[1] - ruby/timeout@14d4212#diff-8ad4c142bc670fe498191f02758e39480e7b06e3ff80be9abfc1d73337d35a83L131

Copy link
Contributor

@adamruzicka adamruzicka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, TimeoutError used to be an alias for Timeout::Error, let's get thin

@adamruzicka adamruzicka merged commit 174ecca into theforeman:master Nov 12, 2024
21 of 22 checks passed
@adamruzicka
Copy link
Contributor

Thank you @m-bucher !

@m-bucher m-bucher deleted the fix_exception_name branch November 12, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants