Sunday, 5 April 2015

exception in mscrm

internal static void ThrowException(Exception exception, ITracingService trace, string pluginName)
        {
            exception = exception.InnerException != null ? exception.InnerException : exception;

            trace.Trace("Error message: {0}", exception.Message);
            trace.Trace("Error StackTrace: {0}", exception.StackTrace);
            trace.Trace("Error Source: {0}", exception.Source);
            trace.Trace("Error TargetSite: {0}", exception.TargetSite);
            throw new InvalidPluginExecutionException(string.Format("An error has occured in the {0} plugin. Please download the error trace and contact the system administrator. Message: {1}", pluginName, exception.Message), exception);
        }

No comments:

Post a Comment