cancel
Showing results for 
Search instead for 
Did you mean: 

Errorhandling with Piers' RFC library

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (0)