this fixes an issue with nexposeapi errors

on newer versions of the nexpose api the error
XML schema has been changed, this prevents the
exception from being generated correctly

MS-289
bug/bundler_fix
David Maloney 2016-10-31 13:42:15 -05:00
parent fd7b14ed48
commit ac0984e8dd
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
1 changed files with 19 additions and 0 deletions

View File

@ -182,6 +182,25 @@ class APIRequest
end
end
@res.elements.each('//Failure') do |s|
# 1.1 returns lower case elements
s.elements.each('message') do |m|
@error = m.text
end
s.elements.each('stacktrace') do |m|
@trace = m.text
end
# 1.2 returns capitalized elements
s.elements.each('Message') do |m|
@error = m.text
end
s.elements.each('Stacktrace') do |m|
@trace = m.text
end
end
# This is a hack to handle corner cases where a heavily loaded Nexpose instance
# drops our HTTP connection before processing. We try 5 times to establish a
# connection in these situations. The actual exception occurs in the Ruby