comparison src/c/driver.c @ 548:b3b06fef7bb5

Treat user-provided error messages as XML
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Dec 2008 11:19:13 -0500
parents e18c747dd945
children 6daa59a55c43
comparison
equal deleted inserted replaced
547:8e615bb605c9 548:b3b06fef7bb5
253 else if (fk == FATAL) { 253 else if (fk == FATAL) {
254 printf("Fatal error: %s\n", uw_error_message(ctx)); 254 printf("Fatal error: %s\n", uw_error_message(ctx));
255 255
256 uw_reset_keep_error_message(ctx); 256 uw_reset_keep_error_message(ctx);
257 uw_write_header(ctx, "HTTP/1.1 500 Internal Server Error\r\n"); 257 uw_write_header(ctx, "HTTP/1.1 500 Internal Server Error\r\n");
258 uw_write_header(ctx, "Content-type: text/plain\r\n"); 258 uw_write_header(ctx, "Content-type: text/html\r\n");
259 uw_write(ctx, "<html><head><title>Fatal Error</title></head><body>");
259 uw_write(ctx, "Fatal error: "); 260 uw_write(ctx, "Fatal error: ");
260 uw_write(ctx, uw_error_message(ctx)); 261 uw_write(ctx, uw_error_message(ctx));
261 uw_write(ctx, "\n"); 262 uw_write(ctx, "\n</body></html>");
262 263
263 try_rollback(ctx); 264 try_rollback(ctx);
264 265
265 break; 266 break;
266 } else { 267 } else {