diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-02-14 12:30:58 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-02-14 12:30:58 +0000 |
commit | 02ab47346dda4a0035afa82db4abe550cb2d838b (patch) | |
tree | 687c7d557edb3d899438020f209438b0a409cc11 /lib | |
parent | 82b553fe5a5ad6406045229d5929c6328da6ecc2 (diff) |
Try to fail more graciously when net/https is not loadable (usually because of missing Ruby/OpenSSL bindings)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/core/utils/httputil.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rbot/core/utils/httputil.rb b/lib/rbot/core/utils/httputil.rb index 42b7fdb8..7566aca4 100644 --- a/lib/rbot/core/utils/httputil.rb +++ b/lib/rbot/core/utils/httputil.rb @@ -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) |