From: Adam Dickmeiss Date: Mon, 21 Jun 2010 11:23:36 +0000 (+0200) Subject: Refactor to use YAZ_SRW-diagnostic codes X-Git-Tag: v1.1.6~3 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=1439d0bf10a879e94e7edfdc813b514328d93070;p=metaproxy-moved-to-github.git Refactor to use YAZ_SRW-diagnostic codes --- diff --git a/src/filter_sru_to_z3950.cpp b/src/filter_sru_to_z3950.cpp index 8c74017..ba1f6af 100644 --- a/src/filter_sru_to_z3950.cpp +++ b/src/filter_sru_to_z3950.cpp @@ -487,7 +487,8 @@ bool yf::SRUtoZ3950::Impl::z3950_search_request(mp::Package &package, yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 7, "query"); + YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED, + "query"); return false; } @@ -512,7 +513,7 @@ bool yf::SRUtoZ3950::Impl::z3950_search_request(mp::Package &package, yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 2, 0); + YAZ_SRW_SYSTEM_TEMPORARILY_UNAVAILABLE, 0); return false; } diff --git a/src/sru_util.cpp b/src/sru_util.cpp index fce602e..3d8b955 100644 --- a/src/sru_util.cpp +++ b/src/sru_util.cpp @@ -286,11 +286,13 @@ mp_util::check_sru_query_exists(mp::Package &package, yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 7, "query"); + YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED, + "query"); yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 10, "CQL query is empty"); + YAZ_SRW_QUERY_SYNTAX_ERROR, + "CQL query is empty"); return false; } if ((sr_req->query_type == Z_SRW_query_type_xcql && !sr_req->query.xcql)) @@ -298,7 +300,8 @@ mp_util::check_sru_query_exists(mp::Package &package, yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 10, "XCQL query is empty"); + YAZ_SRW_QUERY_SYNTAX_ERROR, + "XCQL query is empty"); return false; } if ((sr_req->query_type == Z_SRW_query_type_pqf && !sr_req->query.pqf)) @@ -306,7 +309,8 @@ mp_util::check_sru_query_exists(mp::Package &package, yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 10, "PQF query is empty"); + YAZ_SRW_QUERY_SYNTAX_ERROR, + "PQF query is empty"); return false; } return true;