on 02-13-2007 11:18 PM
Hi together,
I was playing around with getting some error messages back from the backend, if any.
I was able to do <i>rescue RuntimeError</i> to handle errors like wrong user name or pwd or using a wrong function module name.
However some errors occur in the background and I found them listed in the trc file (e.g. like RFC_INVALID_HANDLE).
Is there an overview about what kind of errors are raised, that I can rescue the different errors a different way?
Further does a mapping exists between abap errors and ruby error types with regards to RFCs?
Is there an easy way to get the error messages from the trc file into my ruby code?
Thanks for you answer.
Best,
Stefan
Message was edited by:
Stefan Huettenrauch
Hi -
On connect(), and discover() you get a rb_eRuntimeError with the string containing the group, key, and message.
On call() you get a StandardError which can be trapped like this:
[code]
i = @rfc.discover("STFC_EXCEPTION")
begin
@rfc.call(i)
rescue StandardError => e
$stderr.print "error: #{e.message.inspect}\n"
end
[/code]
Cheers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.