/// <summary> /// Convert exception to Exception Stack /// </summary> /// <returns>ExceptionStack based on exception</returns> internal IEnumerable <ExceptionStack> GetExceptionStack() { if (!ExceptionTypeReport) { return(null); } return(ExceptionStack.Convert(Exception)); }
public static void el(Exception ex) { ConsoleColor cc = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; ExceptionStack es = ex as ExceptionStack; if (es == null) { pl(debug ? ex.ToString() : ex.Message); } else { es.stack.ForEach(e => pl(debug ? e.ToString() : e.Message)); } Console.ForegroundColor = cc; }
public InterpreterState(Stack stack, FloatingPointStack floatingPointStack, ObjectStack objectStack, ReturnStack returnStack, ExceptionStack exceptionStack, InputSourceStack inputSourceStack, Heap heap, ObjectHeap objectHeap, IWordsList wordsList) { Stack = stack ?? throw new ArgumentNullException(nameof(stack)); FloatingPointStack = floatingPointStack ?? throw new ArgumentNullException(nameof(floatingPointStack)); ObjectStack = objectStack ?? throw new ArgumentNullException(nameof(objectStack)); ReturnStack = returnStack ?? throw new ArgumentNullException(nameof(returnStack)); ExceptionStack = exceptionStack ?? throw new ArgumentNullException(nameof(exceptionStack)); InputSourceStack = inputSourceStack ?? throw new ArgumentNullException(nameof(inputSourceStack)); Heap = heap ?? throw new ArgumentNullException(nameof(heap)); ObjectHeap = objectHeap ?? throw new ArgumentNullException(nameof(objectHeap)); Picture = string.Empty; WordsList = wordsList ?? throw new ArgumentNullException(nameof(wordsList)); _stacksRegistry = new Dictionary <string, IStack>(); RegisterDefaultStacks(); SetupDefaults(); }