Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to get the returned error messages in the Try/Catch block in DS 3.0?

A customer sent me the following questions when he tried to implement custom error handling in DS 3.0. I could only find the function "smtp_to" can return the last few lines of trace or error log file but this is not what he wants. Does anyone know the answers? Thanks!


I am trying to implement the Try/Catch for error handling, but I have

hard time to get the return the msg from DI, so I can write it to out

custom log table.

Can you tell me or point me to sample code that can do this, also, can

you tell me which tables capture these info if I want to query it from

DI system tables

Former Member
Former Member replied

Hi Larry,

In Data Services XI 3.1 (GAd yesterday) we made several enhancements for our Try/Catch blocks. One of them is the additional of functions to get details on the error that was catched :

- error_message() Returns the error message of the caught exception

- error_number() Returns the error number of the caught exception

- error_timestamp() Returns the timestamp of the caught exception.

- error_context() Returns the context of the caught exception. For example, "|Session Datapreview_job|Dataflow debug_DataFlow|Transform Debug"

In previous versions, the only thing you could do was in the mail_to function specify the number of lines you want to include from the error_log, which would send the error_log details in the body of the mail.




0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question