]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Try to fail more graciously when net/https is not loadable (usually because of missin...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 14 Feb 2007 12:30:58 +0000 (12:30 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 14 Feb 2007 12:30:58 +0000 (12:30 +0000)
lib/rbot/core/utils/httputil.rb

index 42b7fdb84739c64405f587b2205bebb4f22620ae..7566aca4e1044b6e22f340f9ac16c55b6d386348 100644 (file)
@@ -3,7 +3,13 @@ module Utils
 
 require 'resolv'
 require 'net/http'
-require 'net/https'
+begin
+  require 'net/https'
+rescue LoadError => e
+  error "Coudln't load 'net/https':  #{e.inspect}"
+  error "Secured HTTP connections will fail"
+end
+
 Net::HTTP.version_1_2
 
 # class for making http requests easier (mainly for plugins to use)