using ZelWiki.Engine.Library.Interfaces; using ZelWiki.Repository; namespace ZelWiki.Engine.Implementation { /// /// Handles exceptions thrown by the wiki engine. /// public class ExceptionHandler : IExceptionHandler { /// /// Called when an exception is thrown by the wiki engine. /// /// Reference to the wiki state object /// Optional exception, in the case that this was an actual exception. /// Text that accompanies the exception. public void Log(IZelEngineState state, Exception? ex, string customText) { if (ex != null) { ExceptionRepository.InsertException(ex, customText); } ExceptionRepository.InsertException(customText); } } }