Logging interceptor errors

Hello all.

I've put together a few service interceptors, so I've broken the ice as far as how to get started.  But I recently discovered that one of my interceptors is causing errors.  I'm pretty sure I've isolated which of the three is causing it, and it's a pretty straight-forward error (Unable to cast object of type 'System.Int32' to type 'System.String').  It got me thinking, though... Is there a way to get more detailed information about errors?

The interceptors I have are not particularly lengthy so I'm confident that I can pick through and find where I went wrong and fix it, but if it were more complex then I might have an issue.  Maybe this is a basic C# thing that I haven't learned yet - should I be looking in that direction?  Or is there a way to get Tessitura to give me more details?  I've been able to reproduce the error in our TEST environment, and I can set the NLog to Trace or Debug there comfortably, but even that isn't giving me any specifics about where in the plugin the problem comes up.  Any suggestions?

Thanks very much!
Nathan 

Parents
  • Nathan,

    You can have a try catch block in your code and write to the nlog file the exception or the other details that are useful.

     

     

    public static PluginData Operation(PluginData input){

     

     

    try{

    //Interceptor code

    }

    catch (Exception ex){

    input.Logger.Log(NLog.

     

    LogLevel.Error, "Plugin: " + ex.Message);

     }

    }

     

    Jon

Reply
  • Nathan,

    You can have a try catch block in your code and write to the nlog file the exception or the other details that are useful.

     

     

    public static PluginData Operation(PluginData input){

     

     

    try{

    //Interceptor code

    }

    catch (Exception ex){

    input.Logger.Log(NLog.

     

    LogLevel.Error, "Plugin: " + ex.Message);

     }

    }

     

    Jon

Children