Esempio n. 1
0
        public static DroneCompilerException Get(CSharpCompilerResult result)
        {
            if(result.IsSuccess)
                throw new InvalidOperationException("unable to create drone compiler exception from success result");

            var ex = new DroneCompilerException("drone compiler error", result.Failure.Exception);
            return ex;
        }
Esempio n. 2
0
        public void LogResult(CSharpCompilerResult result)
        {
            if(result == null)
                throw new ArgumentNullException("result");

            foreach (var line in result.OutputTextLines)
                this.log.Info(line);

            foreach (var line in result.WarningTextLines)
                this.log.Warn(line);

            if (!result.IsSuccess)
            {
                foreach (var line in result.Failure.ErrorTextLines)
                    this.log.Error(line);

                if(result.Failure.Exception != null)
                    this.log.ExceptionAndData(result.Failure.Exception);
            }
        }