When performing a z39.50 search during cataloging, there are various errors that can be returned from ZOOM.. these have errors codes, but they also have nicer strings too.. which we're hiding! We should return both in the result.
Created attachment 169953 [details] [review] Bug 37546: Output error message from ZOOM in Z3950 errors
How does one test this?
Ohh I am curious about this as well
I found this whilst hitting a Z39.50 server that was misconfigured somewhere.. it's since working so I'm not able to offer a simple test plan.. The code is simple to read however.. we're just grabbing the message as well as the code now and displaying where we once only displayed the error code. It makes debugging Z connections easier basically.
Could it be possible to enable the publicserver in the Koha Zebra config, and have Koha talk to it's own Z39.50 server?
Yes we can! Add a new Z39.50 server with these settings: Hostname: localhost Port: 2100 Database: biblios Syntax: MARC21/USMARC But not sure how to tweak the config to make it return relevant error codes? I tried changing <retrieval syntax="usmarc" name="marc21"/> to <retrieval syntax="usmarc" name="nope"/> in /etc/koha/sites/kohadev/z3950/config.xml, but that still gives results. There was something else I tried that just gave "No results".
PS I tested this in KTD, and started it with "ktd --es7 up", since the "Z39.50 responder" relies on Elasticsearch.
This is such a trivial and clear bugfix in code. It really helps debug Z connections down the line if you come across any.
I also tried messing with the Zebra config but with no luck, but I was able to trigger the code added by the patch, so yay! Basically, I uncomment "publicserver" in the koha-conf.xml, restart the Zebra server, make note of the TCP port used by zebrasrv (you could assign a port in koha-conf.xml but anyway...), setup the Koha Z39.50 server, but set it to UNIMARC instead of USMARC. Then when I do a Keyword search for "test", I get the following: KOHA record 1: 239 - Record syntax not supported KOHA record 2: 239 - Record syntax not supported - I am going to mark it as Failed QA for now, because I think this is misleading. Instead of "record", I think I'd say "result". I'm going to upload a screenshot of my test, and then add some more commentary...
Created attachment 176422 [details] Example error message
(In reply to Magnus Enger from comment #7) > PS > > I tested this in KTD, and started it with "ktd --es7 up", since the "Z39.50 > responder" relies on Elasticsearch. Note that my test plan doesn't work with the z3950_responder.pl since it appears to ignore the syntax sent with the Z39.50 query...
(In reply to David Cook from comment #9) > I am going to mark it as Failed QA for now, because I think this is > misleading. > > Instead of "record", I think I'd say "result". I'm going to upload a > screenshot of my test, and then add some more commentary... I think it would be wise to wrap the Z39.50 error message in quotes. At first, I thought 239 might be the bib number, and then I thought there might be a bug... and then I realised that "239" is actually the error code. So it might also be worthwhile to write it out like... "[Error code: 239] - Record syntax not support" If you look at https://www.loc.gov/z3950/agency/contributions/1.html they suggest a "Recommended display" but it would require way too much work I reckon. But... we could do a hybrid like: "Record syntax not supported (ref. 239)" Because then I search "z39.50 ref 239" in a search engine, and I get useful data for my first hit.
Sorry for all the messages... Additionally, it could be worthwhile wrapping the server data too: "[Server: KOHA]" Alternatively, I suppose to be more in line with other errors that say "failed to SERVER" or "timeout to SERVER": "Record syntax not supported (ref. 239) from KOHA" -- Anyway, now we have a reproducible test plan, this should be an easy one to move forward :D
Created attachment 176423 [details] [review] Bug 37546: Output error message from ZOOM in Z3950 errors
Created attachment 176424 [details] [review] Bug 37546: Error message output improvements As suggested by David, I've re-arranged the message output so we pass 'message' first, followed by the error reference inside brackets, followed by "for SERVER" and finally "result No." This follows the Z39.50 suggestions more closely whilst still including our level of detail for Server + Result number.
Hows that ?
(In reply to Martin Renvoize (ashimema) from comment #16) > Hows that ? Good enough for me :)
Created attachment 176482 [details] [review] Bug 37546: Output error message from ZOOM in Z3950 errors Signed-off-by: David Cook <dcook@prosentient.com.au>
Created attachment 176483 [details] [review] Bug 37546: Error message output improvements As suggested by David, I've re-arranged the message output so we pass 'message' first, followed by the error reference inside brackets, followed by "for SERVER" and finally "result No." This follows the Z39.50 suggestions more closely whilst still including our level of detail for Server + Result number. Signed-off-by: David Cook <dcook@prosentient.com.au>
(In reply to Martin Renvoize (ashimema) from comment #16) > Hows that ? Oh man... looking at it again today... your change was even smaller than I realised. Sorry for my earlier feedback. That misleading wording was already there. Blah.