From: Adam Dickmeiss Date: Wed, 7 Oct 2009 12:35:41 +0000 (+0200) Subject: Other behavior misconfigured targets bug #2242 X-Git-Tag: v1.2.2~27^2~2 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=d147123d37c5a6b47afb6fcfe4c32c07900087e9;p=pazpar2-moved-to-github.git Other behavior misconfigured targets bug #2242 Pazpar2 will no longer return errors for individual targets .. such as unknown stylesheets.. It will still be reported in the Pazpar2 log. If all targets cannot be configured, it will return 'No targets'. --- diff --git a/src/logic.c b/src/logic.c index e393214..2b9fbd5 100644 --- a/src/logic.c +++ b/src/logic.c @@ -320,6 +320,8 @@ static int prepare_map(struct session *se, struct session_database *sdb) } } sdb->map = normalize_record_create(se->service, s); + if (!sdb->map) + return -1; } return 0; } @@ -499,10 +501,7 @@ enum pazpar2_error_code search(struct session *se, for (cl = se->clients; cl; cl = client_next_in_session(cl)) { if (prepare_session_database(se, client_get_database(cl)) < 0) - { - *addinfo = client_get_database(cl)->database->url; - return PAZPAR2_CONFIG_TARGET; - } + continue; // Parse query for target if (client_parse_query(cl, query) < 0) no_failed++; @@ -510,16 +509,19 @@ enum pazpar2_error_code search(struct session *se, { no_working++; if (client_prep_connection(cl, se->service->z3950_operation_timeout, - se->service->z3950_session_timeout)) + se->service->z3950_session_timeout)) client_start_search(cl); } } - - // If no queries could be mapped, we signal an error if (no_working == 0) { - *addinfo = "query"; - return PAZPAR2_MALFORMED_PARAMETER_VALUE; + if (no_failed > 0) + { + *addinfo = "query"; + return PAZPAR2_MALFORMED_PARAMETER_VALUE; + } + else + return PAZPAR2_NO_TARGETS; } return PAZPAR2_NO_ERROR; }