K2 Errors

  • 3 May 2005
  • 1 reply
  • 6 views

Badge +1
I want to send an email (log a ticket in our Help Desk System) with the error information generated in K2. The email is being created in the Process Exceptions code block.

However I don't know how to get to the error information (that you would see in the Service Manager). Right now I'm just returning the K2.ContextType.ToString().

How do I get to the error that was generated so I can include it in the email?

Thanks.

1 reply

Badge +8
Try

K2.ExceptionObject.ToString()

to get the error information.

If this is only a notification and you are not 'handling' the error as such, remember to throw an exception after sending the notification so that the process instance will be in 'error' state to enable an admin to view and repair the error using K2 Service Manager.
Use the following code to put the process in 'error' state after sending the notification:


throw new ApplicationException(K2.ExceptionObject.ToString());

Reply