From 064a422245f2ef4e881f50350dbbf686283ae310 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 2 May 2001 00:18:08 +0000 Subject: Pouet --- lib/exceptions.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/exceptions.c') diff --git a/lib/exceptions.c b/lib/exceptions.c index 72842a4..89d15c4 100644 --- a/lib/exceptions.c +++ b/lib/exceptions.c @@ -14,6 +14,7 @@ #endif #include "exceptions.h" #include "pile.h" +#include "terminal.h" char *contexts[128]; int clevel = 0; @@ -81,6 +82,10 @@ void exception(int level, char *msg) int i; switch (level) { case 1: + fprintf(stderr, "Error detected. Showing context.\n"); + for (i = 0; i < clevel; i++) { + fprintf(stderr, " (%i) - %s\n", i, contexts[i]); + } fprintf(stderr, " Error description: %s\n", msg); flush_pile(); global_error = 1; @@ -91,6 +96,7 @@ void exception(int level, char *msg) fprintf(stderr, " (%i) - %s\n", i, contexts[i]); } fprintf(stderr, " Error description: %s\n", msg); + clearterm(); exit(1); break; } -- cgit v1.2.3