Process Exceptions

  • 12 November 2008
  • 2 replies
  • 2 views

Badge +3

My current client has an existing exception management library that they'd like me to use on this project.  This library sends the exception information via mail to a list of users.  I'd like to attach this to the Process Exception handler, but I'm not sure where to get the actual exception that occurred.  The K2.ExceptionObject doesn't appear to derive from System.Exception.  I've attached a sample of what I'm attempting to accomplish.  Am I just missing something completely?


 


        #region - K2 Context -
        private HostContext _K2;
        [EditorBrowsable(EditorBrowsableState.Never)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public HostContext K2
        {
            get { return _K2; }
            set { _K2 = value; }
        }
        #endregion


        #region - Properties_ExecuteCode -
        private void Properties_ExecuteCode(object sender, EventArgs e)
        {
            K2.AddToErrorLog = K2.Configuration.IsErrorLog;


            K2.AddToServerLog = K2.Configuration.IsServerLog;


            ClientLibrary.ErrorHandler handler = new ClientLibrary.ErrorHandler(K2.ExceptionObject, null); /***** This line doesn't build *****/


            handler.SendException();
        }
        #endregion


2 replies

Badge +3

I modified the code above to attempt to cast the K2.ExceptionObject to Exception.  The code builds and deploys, but despite the fact that I'm throwing an exception in a smart object, this code never seems to execute.


 

Badge +3

I think I've answered my own questions


 1) Casting K2ExceptionObject to Exception works


2) The process exception handler isn't called when exceptions occur in the Smart Object Service, I'll need to handle those separately.


 

Reply