/// <summary> /// Sets the LastException of the host from an existing /// RazorHostContainer exception /// </summary> /// <param name="ex"></param> protected virtual void SetErrorException(RazorHostContainerException ex) { LastException = ex; if (ThrowExceptions && LastException != null) { throw LastException; } }
/// <summary> /// Sets an error message consistently /// </summary> /// <param name="message"></param> protected virtual void SetError(string message) { if (string.IsNullOrEmpty(message)) { LastException = null; return; } LastException = new RazorHostContainerException(message, Engine?.LastGeneratedCode, Engine?.LastException, Engine?.TemplatePerRequestConfigurationData); if (ThrowExceptions) { throw LastException; } }