Skip to content

Commit 09c7776

Browse files
committed
tweaked error message handling
1 parent adce0f1 commit 09c7776

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

server.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ function serveTest(query, response)
259259
html.push(h(str_options));
260260
html.push("</td>\n");
261261
html.push("\t</tr>\n");
262-
html.push("</table>\n");
263262

264263
var compileTest = null;
265264

@@ -269,13 +268,18 @@ function serveTest(query, response)
269268
}
270269
catch (err)
271270
{
272-
html.push('<div class="alert alert-error">Error: ');
271+
html.push('\t<tr>\n');
272+
html.push('\t\t<td>Error:</td>\n');
273+
html.push('\t\t<td>');
273274
html.push(h(err.message));
274-
html.push("</div>");
275-
response.write(JSON.stringify({"success": true, "message": "unable to create XRegExp object", "html": html.join("")}));
275+
html.push('</td>\n');
276+
html.push('\t</tr>\n');
277+
html.push('</table>\n');
278+
response.write(JSON.stringify({"success": false, "message": "unable to create XRegExp object", "html": html.join("")}));
276279
response.end();
277280
return;
278281
}
282+
html.push("</table>\n");
279283

280284
html.push('<table class=\"table table-bordered table-striped\">\n');
281285

0 commit comments

Comments
 (0)