public void MappingSassCompilerLoadErrorDuringCompilationOfFile() { // Arrange IJsEngineFactory jsEngineFactory = new NiLJsEngineFactory(); string inputPath = GenerateSassFilePath("simplest-working", "style"); // Act string output; SassCompilerLoadException exception = null; try { using (var sassCompiler = CreateSassCompiler(jsEngineFactory)) { output = sassCompiler.CompileFile(inputPath).CompiledContent; } } catch (SassCompilerLoadException e) { exception = e; } // Assert Assert.NotNull(exception); Assert.AreEqual( "During loading of Sass compiler error has occurred. See the original error message: " + "“TypeError: Can't set property \"keys\" of \"undefined\"”.", exception.Message ); Assert.AreEqual("TypeError: Can't set property \"keys\" of \"undefined\"", exception.Description); }
internal static SassCompilerLoadException WrapCompilerLoadException(Exception exception, bool quoteDescription = false) { string description = exception.Message; string message = GenerateCompilerLoadErrorMessage(description, quoteDescription); var sassCompilerLoadException = new SassCompilerLoadException(message, exception) { Description = description }; return(sassCompilerLoadException); }