Skip to content

Commit

Permalink
exception variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime committed May 3, 2024
1 parent fa472cd commit d5f4e24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/launchy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def open(uri_s, options = {})
end

app.new.open(uri, leftover)
rescue Launchy::Error => le
raise le
rescue Launchy::Error => e
raise e
rescue StandardError => e
msg = "Failure in opening uri #{uri_s.inspect} with options #{options.inspect}: #{e}"
raise Launchy::Error, msg
Expand Down
4 changes: 2 additions & 2 deletions lib/launchy/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def parser
def parse(argv, _env)
parser.parse!(argv)
return true
rescue ::OptionParser::ParseError => pe
error_output(pe)
rescue ::OptionParser::ParseError => e
error_output(e)
end

def good_run(argv, env)
Expand Down
4 changes: 2 additions & 2 deletions spec/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
def cli_test(argv, env, exit_val, stderr_regex, stdout_regex)
begin
Launchy::Cli.new.run(argv, env)
rescue SystemExit => se
_(se.status).must_equal exit_val
rescue SystemExit => e
_(e.status).must_equal exit_val
_($stderr.string).must_match stderr_regex if stderr_regex
_($stdout.string).must_match stdout_regex if stdout_regex
end
Expand Down

0 comments on commit d5f4e24

Please sign in to comment.