From 217fc7cde975f21beff18c136baf5ec7c2e51007 Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Mon, 16 Mar 2015 22:40:46 +1030 Subject: [PATCH] Improve diagnostic logging and HTTP responses --- rhizome_restful.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rhizome_restful.c b/rhizome_restful.c index 37633934..8ad0ec27 100644 --- a/rhizome_restful.c +++ b/rhizome_restful.c @@ -455,7 +455,7 @@ static int insert_mime_part_header(struct http_request *hr, const struct mime_pa if (r->u.insert.is_append) { r->payload_status = rhizome_write_open_journal(&r->u.insert.write, r->manifest, 0, RHIZOME_SIZE_UNSET); if (r->payload_status == RHIZOME_PAYLOAD_STATUS_ERROR) { - WHYF("rhizome_write_open_journal() returned %d", r->payload_status); + WHYF("rhizome_write_open_journal() returned %s", rhizome_payload_status_message(r->payload_status)); return 500; } } else { @@ -463,7 +463,7 @@ static int insert_mime_part_header(struct http_request *hr, const struct mime_pa // not contain a 'filesize' field. r->payload_status = rhizome_write_open_manifest(&r->u.insert.write, r->manifest); if (r->payload_status == RHIZOME_PAYLOAD_STATUS_ERROR) { - WHYF("rhizome_write_open_manifest() returned %d", r->payload_status); + WHYF("rhizome_write_open_manifest() returned %s", rhizome_payload_status_message(r->payload_status)); return 500; } } @@ -553,7 +553,7 @@ static int insert_mime_part_end(struct http_request *hr) } } else { if (rhizome_new_bundle_from_secret(r->manifest, &r->u.insert.bundle_secret) == -1) { - WHY("Failed to create bundle from secret"); + http_request_simple_response(&r->http, 500, "Internal error: Failed to create bundle from secret"); return 500; } }