Patch for easier spotting of invalid data in SOAP requests

0 views
Skip to first unread message

Christoph_Petschnig

unread,
Jun 11, 2008, 4:42:28 AM6/11/08
to soap4r
Hello!

When you have invalid data in your SOAP request, it's sometimes hard
to spot the location. This patch helps a lot. It forwards the
exception trough the parsing tree and adds the branch to the exception
message.

File lib/soap/baseData.rb, starting with line 615


def each
idx = 0
while idx < @array.length
begin
yield(@array[idx], @data[idx])
rescue Exception => e
e2 = e.class.new
class <<e2
attr_accessor :original_message
attr_accessor :path
end
e2.original_message = e.methods.include?("original_message") ?
e.original_message : e.message
e2.path = @array[idx] + (e.methods.include?("path") ? '/' +
e.path : '')
raise e2.exception(e2.original_message + " in #{e2.path}")
end
idx += 1
end
end


Sorry, I have no diff/patch tool avaliable at the moment.
Reply all
Reply to author
Forward
0 new messages