Skip to content

Commit

Permalink
Catch web browser launching failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelebleu committed Jun 21, 2016
1 parent 0841444 commit 430aeff
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions config.ru
Expand Up @@ -43,12 +43,20 @@ if "#{$PROGRAM_NAME}".include?("tabula.jar")
if have_desktop
puts "\n======================================================"
puts "Launching web browser to #{url}\n\n"
puts "If it does not open in 10 seconds, you may manually open"
puts "a web browser to the above URL."

begin
desktop.browse(uri)
rescue
puts "Unable to launch your web browser, you will have to"
puts "manually open it to the above URL."
else
puts "If it does not open in 10 seconds, you may manually open"
puts "a web browser to the above URL."
end

puts "When you're done using the Tabula interface, you may"
puts "return to this window and press \"Control-C\" to close it."
puts "======================================================\n\n"
desktop.browse(uri)
else
puts "\n======================================================"
puts "Server now listening at: #{url}\n\n"
Expand Down

0 comments on commit 430aeff

Please sign in to comment.