r1333 - in branches/1.0: . lib/libvcl

des at projects.linpro.no des at projects.linpro.no
Thu Apr 19 16:50:54 CEST 2007


Author: des
Date: 2007-04-19 16:50:54 +0200 (Thu, 19 Apr 2007)
New Revision: 1333

Modified:
   branches/1.0/
   branches/1.0/lib/libvcl/vcc_compile.c
   branches/1.0/lib/libvcl/vcc_token.c
Log:
 r37066 at cat (orig r1290):  phk | 2007-03-31 09:43:05 +0200
 Improve error message layout and information.
 



Property changes on: branches/1.0
___________________________________________________________________
Name: svk:merge
   - d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1289
   + d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1290

Modified: branches/1.0/lib/libvcl/vcc_compile.c
===================================================================
--- branches/1.0/lib/libvcl/vcc_compile.c	2007-04-19 14:50:52 UTC (rev 1332)
+++ branches/1.0/lib/libvcl/vcc_compile.c	2007-04-19 14:50:54 UTC (rev 1333)
@@ -395,21 +395,20 @@
 	if (u) {
 #define VCL_RET_MAC(a, b, c, d) \
 		if (u & VCL_RET_##b) { \
-			vsb_printf(tl->sb, "Illegal return for method\n"); \
+			vsb_printf(tl->sb, "Illegal action \"%s\"\n", #a); \
 			vcc_ErrWhere(tl, p->returnt[d]); \
 		}
 #include "vcl_returns.h"
 #undef VCL_RET_MAC
-		vsb_printf(tl->sb, "In function\n");
+		vsb_printf(tl->sb, "\n...in function \"%.*s\"\n", PF(p->name));
 		vcc_ErrWhere(tl, p->name);
 		return (1);
 	}
 	p->active = 1;
 	TAILQ_FOREACH(pc, &p->calls, list) {
 		if (Consist_Decend(tl, pc->p, returns)) {
-			vsb_printf(tl->sb, "\nCalled from\n");
-			vcc_ErrWhere(tl, p->name);
-			vsb_printf(tl->sb, "at\n");
+			vsb_printf(tl->sb, "\n...called from \"%.*s\"\n",
+			    PF(p->name));
 			vcc_ErrWhere(tl, pc->t);
 			return (1);
 		}
@@ -434,7 +433,16 @@
 			continue;
 		if (Consist_Decend(tl, p, m->returns)) {
 			vsb_printf(tl->sb,
-			    "\nwhich is a %s method\n", m->name);
+			    "\n...which is the \"%s\" method\n", m->name);
+			vsb_printf(tl->sb, "Legal actions are:");
+#define VCL_RET_MAC(a, b, c, d) \
+			if (m->returns & c) \
+				vsb_printf(tl->sb, " \"%s\"", #a);
+#define VCL_RET_MAC_E(a, b, c, d) VCL_RET_MAC(a, b, c, d)
+#include "vcl_returns.h"
+#undef VCL_RET_MAC
+#undef VCL_RET_MAC_E
+			vsb_printf(tl->sb, "\n");
 			return (1);
 		}
 	}

Modified: branches/1.0/lib/libvcl/vcc_token.c
===================================================================
--- branches/1.0/lib/libvcl/vcc_token.c	2007-04-19 14:50:52 UTC (rev 1332)
+++ branches/1.0/lib/libvcl/vcc_token.c	2007-04-19 14:50:54 UTC (rev 1333)
@@ -91,7 +91,7 @@
 		} else
 			pos++;
 	}
-	vsb_printf(tl->sb, "In %s Line %d Pos %d\n", f, lin, pos);
+	vsb_printf(tl->sb, "(%s Line %d Pos %d)\n", f, lin, pos);
 	x = y = 0;
 	for (p = l; p < e && *p != '\n'; p++) {
 		if (*p == '\t') {




More information about the varnish-commit mailing list