Sha256: 48d422d48df54c7e95d9790355c716a4659efb2f36aed0c37db08dd9e042f3ae
Contents?: true
Size: 765 Bytes
Versions: 1
Compression:
Stored size: 765 Bytes
Contents
# openfire admin operator module OpenfireAdmin # unexpected response found exception class ResponceException < Exception attr_reader :response def initialize(message,res) case res when Net::HTTPSuccess doc = Nokogiri::HTML(res.body) msgs = ( doc.search('.jive-error-text, .error') || [] ).map{|c| c.text.strip} if msgs.empty? super(message) else super("#{message} [#{msgs.join(' / ')}]") end when Net::HTTPRedirection super("#{message} redirct to=>#{res['location']}") when Net::HTTPNotFound super("#{message} Not found #{res.request.path}") else super("#{message} res.code=#{res.code}") end @response = res end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
openfire_admin-0.0.1 | lib/openfire_admin/response_exception.rb |