From 02ab47346dda4a0035afa82db4abe550cb2d838b Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 14 Feb 2007 12:30:58 +0000 Subject: Try to fail more graciously when net/https is not loadable (usually because of missing Ruby/OpenSSL bindings) --- lib/rbot/core/utils/httputil.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/rbot') 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) -- cgit v1.2.3