improve error display in TEMPL_CONTENT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/gotweb/files/htdocs/gotweb/gotweb.css b/gotweb/files/htdocs/gotweb/gotweb.css
index f79e068..d99338a 100644
--- a/gotweb/files/htdocs/gotweb/gotweb.css
+++ b/gotweb/files/htdocs/gotweb/gotweb.css
@@ -222,6 +222,14 @@ body {
overflow: auto;
white-space: pre-wrap;
}
+#tmpl_err {
+ clear: left;
+ float: left;
+ padding-left: 20px;
+ padding-top: 20px;
+ padding-bottom: 20px;
+ white-space: pre-wrap;
+}
/* headers */
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index dd82868..3f18bb2 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -1700,9 +1700,19 @@ gw_template(size_t key, void *arg)
case(TEMPL_CONTENT):
error = gw_query_funcs[gw_trans->action].func_main(gw_trans);
if (error) {
+ kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
+ KATTR_ID, "tmpl_err", KATTR__MAX);
+ if (kerr != KCGI_OK)
+ return 0;
+ kerr = khttp_puts(gw_trans->gw_req, "Error: ");
+ if (kerr != KCGI_OK)
+ return 0;
kerr = khttp_puts(gw_trans->gw_req, error->msg);
if (kerr != KCGI_OK)
return 0;
+ kerr = khtml_closeelem(gw_trans->gw_html_req, 1);
+ if (kerr != KCGI_OK)
+ return 0;
}
break;
default: