Skip to content

Commit 0ea46c2

Browse files
committed
Merge remote-tracking branch 'origin/release-rnp'
2 parents 3989ee8 + bd7ba7f commit 0ea46c2

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

lib/bigbluebutton_api.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,10 +766,14 @@ def send_request(url, data=nil)
766766
@logger.debug("BigBlueButtonAPI: URL response = #{response.body}")
767767

768768
rescue Timeout::Error => error
769-
raise BigBlueButtonException.new("Timeout error. Your server is probably down: \"#{@url}\". Error: #{error}")
769+
exception = BigBlueButtonException.new("Timeout error. Your server is probably down: \"#{@url}\". Error: #{error}")
770+
exception.key = 'TimeoutError'
771+
raise exception
770772

771773
rescue Exception => error
772-
raise BigBlueButtonException.new("Connection error. Your URL is probably incorrect: \"#{@url}\". Error: #{error}")
774+
exception = BigBlueButtonException.new("Connection error. Your URL is probably incorrect: \"#{@url}\". Error: #{error}")
775+
exception.key = 'IncorrectUrlError'
776+
raise exception
773777
end
774778

775779
response
@@ -785,7 +789,9 @@ def nearest_version(target)
785789

786790
# we don't allow older versions than the one supported, use an old version of the gem for that
787791
if Gem::Version.new(version) < Gem::Version.new(@supported_versions[0])
788-
raise BigBlueButtonException.new("BigBlueButton error: Invalid API version #{version}. Supported versions: #{@supported_versions.join(', ')}")
792+
exception = BigBlueButtonException.new("BigBlueButton error: Invalid API version #{version}. Supported versions: #{@supported_versions.join(', ')}")
793+
exception.key = 'APIVersionError'
794+
raise exception
789795

790796
# allow newer versions by using the newest one we support
791797
elsif Gem::Version.new(version) > Gem::Version.new(@supported_versions.last)

lib/bigbluebutton_config_layout.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def initialize(xml)
2929
begin
3030
@xml = XmlSimple.xml_in(xml, opts)
3131
rescue Exception => e
32-
raise BigBlueButton::BigBlueButtonException.new("Error parsing the layouts XML. Error: #{e.message}")
32+
exception = BigBlueButton::BigBlueButtonException.new("Error parsing the layouts XML. Error: #{e.message}")
33+
exception.key = 'XMLParsingError'
34+
raise exception
3335
end
3436
end
3537

lib/bigbluebutton_config_xml.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def initialize(xml)
3333
@xml = XmlSimple.xml_in(xml, opts)
3434
@original_string = self.as_string.clone
3535
rescue Exception => e
36-
raise BigBlueButton::BigBlueButtonException.new("Error parsing the config XML. Error: #{e.message}")
36+
exception = BigBlueButton::BigBlueButtonException.new("Error parsing the config XML. Error: #{e.message}")
37+
exception.key = 'XMLParsingError'
38+
raise exception
3739
end
3840
end
3941
end

lib/bigbluebutton_hash_to_xml.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ def from_xml(xml_io)
1010
hash = XmlSimple.xml_in(xml_io, opts)
1111
return symbolize_keys(hash)
1212
rescue Exception => e
13-
raise BigBlueButtonException.new("Impossible to convert XML to hash. Error: #{e.message}")
13+
exception = BigBlueButtonException.new("Impossible to convert XML to hash. Error: #{e.message}")
14+
exception.key = 'XMLConversionError'
15+
raise exception
1416
end
1517
end
1618

0 commit comments

Comments
 (0)