From f610400c28d8cb132fa1c5a0dc5fba94d64a751a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 25 Jan 2010 16:19:29 +0100 Subject: [PATCH] New diagnostic: No service . The new diagnostic 'no service' is returned if a service can not be found (whether unnamed or given during init). --- src/http_command.c | 3 ++- src/pazpar2.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/http_command.c b/src/http_command.c index badb77b..e3981b2 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -117,6 +117,7 @@ static const char *get_msg(enum pazpar2_error_code code) { PAZPAR2_CONFIG_TARGET, "Target cannot be configured"}, { PAZPAR2_RECORD_FAIL, "Record command failed"}, { PAZPAR2_NOT_IMPLEMENTED, "Not implemented"}, + { PAZPAR2_NO_SERVICE, "No service"}, { PAZPAR2_LAST_ERROR, "Last error"}, { 0, 0 } }; @@ -279,7 +280,7 @@ static void cmd_init(struct http_channel *c) service = locate_service(c->server, service_name); if (!service) { - error(rs, PAZPAR2_MALFORMED_PARAMETER_VALUE, "service"); + error(rs, PAZPAR2_NO_SERVICE, service_name ? service_name : "unnamed"); return; } service_incref(service); diff --git a/src/pazpar2.h b/src/pazpar2.h index d03cfa0..4a9c26a 100644 --- a/src/pazpar2.h +++ b/src/pazpar2.h @@ -48,6 +48,7 @@ enum pazpar2_error_code { PAZPAR2_CONFIG_TARGET, PAZPAR2_RECORD_FAIL, PAZPAR2_NOT_IMPLEMENTED, + PAZPAR2_NO_SERVICE, PAZPAR2_LAST_ERROR }; -- 1.7.10.4