コード例 #1
0
ファイル: ModuleLoader.cs プロジェクト: zalid/Prism
        /// <summary>
        /// Handles any exception ocurred in the module loading process,
        /// logs the error using the <seealso cref="ILoggerFacade"/> and throws a <seealso cref="ModuleLoadException"/>.
        /// This method can be overriden to provide a different behavior.
        /// </summary>
        /// <param name="moduleInfo">The module metadata where the error happenened.</param>
        /// <param name="assemblyName">The assembly name.</param>
        /// <param name="exception">The exception thrown that is the cause of the current error.</param>
        /// <exception cref="ModuleLoadException"></exception>
        public virtual void HandleModuleLoadError(ModuleInfo moduleInfo, string assemblyName, Exception exception)
        {
            Exception moduleException = new ModuleLoadException(moduleInfo.ModuleName, assemblyName, exception.Message,
                                                                exception);

            loggerFacade.Log(moduleException.Message, Category.Exception, Priority.High);

            throw moduleException;
        }
コード例 #2
0
ファイル: ModuleLoader.cs プロジェクト: eslahi/prism
        /// <summary>
        /// Handles any exception ocurred in the module loading process,
        /// logs the error using the <seealso cref="ILoggerFacade"/> and throws a <seealso cref="ModuleLoadException"/>.
        /// This method can be overriden to provide a different behavior. 
        /// </summary>
        /// <param name="moduleInfo">The module metadata where the error happenened.</param>
        /// <param name="assemblyName">The assembly name.</param>
        /// <param name="exception">The exception thrown that is the cause of the current error.</param>
        /// <exception cref="ModuleLoadException"></exception>
        public virtual void HandleModuleLoadError(ModuleInfo moduleInfo, string assemblyName, Exception exception)
        {
            Exception moduleException = new ModuleLoadException(moduleInfo.ModuleName, assemblyName, exception.Message,
                                                                exception);

            loggerFacade.Log(moduleException.Message, Category.Exception, Priority.High);

            throw moduleException;
        }