Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use local var from rescue rather than "English" global. #99

Merged
merged 1 commit into from

3 participants

@danielsdeleo
Owner

Apparently an Omnibus dependency was requiring "English"
http://www.ruby-doc.org/stdlib-2.0/libdoc/English/rdoc/English.html but
no longer does. That library must be loaded to use $ERROR_INFO. But
since $ERROR_INFO is just $!, the last exception raised, and we already
have a reference to it from rescue => e, we can just use the local
variable instead.

ping @schisamo @sethvargo

@danielsdeleo danielsdeleo Use local var from rescue rather than "English" global.
Apparently an Omnibus dependency was requiring "English"
http://www.ruby-doc.org/stdlib-2.0/libdoc/English/rdoc/English.html but
no longer does. That library must be loaded to use $ERROR_INFO. But
since $ERROR_INFO is just $!, the last exception raised, and we already
have a reference to it from `rescue => e`, we can just use the local
variable instead.
ab5dd37
@sethvargo sethvargo merged commit ab5dd37 into master

1 check passed

Details default The Travis CI build passed
@sethvargo sethvargo deleted the prefer-local-to-global-in-rescue branch
@smith
Owner

Omnibus aint no package I ever heard of. They require English in omnibus?

Omnibus?

English, m*erfer, do you require it?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2014
  1. @danielsdeleo

    Use local var from rescue rather than "English" global.

    danielsdeleo authored
    Apparently an Omnibus dependency was requiring "English"
    http://www.ruby-doc.org/stdlib-2.0/libdoc/English/rdoc/English.html but
    no longer does. That library must be loaded to use $ERROR_INFO. But
    since $ERROR_INFO is just $!, the last exception raised, and we already
    have a reference to it from `rescue => e`, we can just use the local
    variable instead.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/omnibus/cli/application.rb
View
2  lib/omnibus/cli/application.rb
@@ -118,7 +118,7 @@ def self.start(*args)
super
rescue => e
error_msg = 'Something went wrong...the Omnibus just ran off the road!'
- error_msg << "\n\nError raised was:\n\n\t#{$ERROR_INFO}"
+ error_msg << "\n\nError raised was:\n\n\t#{e}"
error_msg << "\n\nBacktrace:\n\n\t#{e.backtrace.join("\n\t") }"
if e.respond_to?(:original) && e.original
error_msg << "\n\nOriginal Error:\n\n\t#{e.original}"
Something went wrong with that request. Please try again.