Skip to content

catch StandardError rather than the gratuitous Exception #586

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

Merged
merged 1 commit into from
Mar 29, 2016

Conversation

ffrank
Copy link
Contributor

@ffrank ffrank commented Mar 29, 2016

Catching Exception is gratuitous and makes Ruby behave weirdly in case of badly timed SIGINTs, SIGTERMs etc.

All proper errors should descend from StandardError rather than Exception directly (Puppet::Error does this). Catching those is much less problematic.

@ripienaar
Copy link

👍

@bmjen
Copy link
Contributor

bmjen commented Mar 29, 2016

Good catch @ffrank !

@bmjen bmjen merged commit c5486ab into puppetlabs:master Mar 29, 2016
@dmitryilyin
Copy link

#588

@DavidS
Copy link
Contributor

DavidS commented Apr 5, 2016

The casualty of this change was parseyaml , because on ruby 1.9.3, Psych::SyntaxError is a RuntimeError 😠

See #589 for a fix.

@ffrank
Copy link
Contributor Author

ffrank commented Apr 6, 2016

Oh wow, so it raises as though someone tried to load invalid Ruby code at runtime. Not sure that's a sound design. Cool workaround though!

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.

6 participants