示例#1
0
文件: AphidCli.cs 项目: 5l1v3r1/Aphid
        public static void DumpException(AphidLoadScriptException exception, AphidInterpreter interpreter)
        {
            WriteErrorMessage(
                StyleEscape(
                    ErrorFormatter.Format(
                        exception,
                        AphidScript.Read(exception.ScriptFile))));

            DumpStackTrace(interpreter, exception);
            DumpScope(exception, interpreter);
        }
示例#2
0
        public static string Format(AphidLoadScriptException exception, string code)
        {
            var sb = new StringBuilder("Load script exception\r\n");
            var t  = exception.LoadScriptExceptionType;

            sb.AppendLine(
                t == AphidExceptionType.ParserException ?
                Format(exception.ParserException, code) :
                t == AphidExceptionType.AphidRuntimeException ?
                Format(exception.AphidRuntimeException) :
                Format(exception.InnerException));

            return(sb.ToString());
        }
示例#3
0
 public void DumpExceptionTest02(AphidLoadScriptException exception, AphidInterpreter interpreter)
 {
     AphidCli.DumpException(exception, interpreter);
     // TODO: add assertions to method AphidCliTest.DumpExceptionTest02(AphidLoadScriptException, AphidInterpreter)
 }