예제 #1
0
        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);
        }
예제 #2
0
        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);
        }