Currently, the code uses error numbers 1 to 7. The method errstr is not widely used. In order to translate error message, we could use a template.
*** Bug 19018 has been marked as a duplicate of this bug. ***
Created attachment 72205 [details] [review] Bug 20272: Replace error numbers by codes in XSLT_Handler We remove the error numbers 1 to 7 by readable codes. And remove the errstr attribute (not used widely). Make XSLT_Handler a little bit less noisy by defaulting print_warns to false unless $ENV{DEBUG} is set. (See also bug 19018). The unit has been changed accordingly. (A few warnings are no longer tested.) Test plan: Run t/db_dependent/XSLT_Handler.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 72206 [details] [review] Bug 20272: Changes for Breeding.pm and Record.pm In Breeding.pm we let Z3950Search return the xslt handler error codes back to the template. They are converted to text messages by using an new include file (added for opac and intranet now). The generic xslt_err code is now obsoleted. In Record.pm the errstr call is removed. The croak is done with the new error code in err. This seems sufficient. Test plan: [1] Run Breeding.t [2] Run Record.t [3] Add a nonexisting xslt file to one of your Z3950 targets. Search on that target and check if you see a error 'XSLT file not found'. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 72916 [details] [review] Bug 20272: Replace error numbers by codes in XSLT_Handler We remove the error numbers 1 to 7 by readable codes. And remove the errstr attribute (not used widely). Make XSLT_Handler a little bit less noisy by defaulting print_warns to false unless $ENV{DEBUG} is set. (See also bug 19018). The unit has been changed accordingly. (A few warnings are no longer tested.) Test plan: Run t/db_dependent/XSLT_Handler.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Created attachment 72917 [details] [review] Bug 20272: Changes for Breeding.pm and Record.pm In Breeding.pm we let Z3950Search return the xslt handler error codes back to the template. They are converted to text messages by using an new include file (added for opac and intranet now). The generic xslt_err code is now obsoleted. In Record.pm the errstr call is removed. The croak is done with the new error code in err. This seems sufficient. Test plan: [1] Run Breeding.t [2] Run Record.t [3] Add a nonexisting xslt file to one of your Z3950 targets. Search on that target and check if you see a error 'XSLT file not found'. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Created attachment 75582 [details] [review] Bug 20272: Replace error numbers by codes in XSLT_Handler We remove the error numbers 1 to 7 by readable codes. And remove the errstr attribute (not used widely). Make XSLT_Handler a little bit less noisy by defaulting print_warns to false unless $ENV{DEBUG} is set. (See also bug 19018). The unit has been changed accordingly. (A few warnings are no longer tested.) Test plan: Run t/db_dependent/XSLT_Handler.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Created attachment 75583 [details] [review] Bug 20272: Changes for Breeding.pm and Record.pm In Breeding.pm we let Z3950Search return the xslt handler error codes back to the template. They are converted to text messages by using an new include file (added for opac and intranet now). The generic xslt_err code is now obsoleted. In Record.pm the errstr call is removed. The croak is done with the new error code in err. This seems sufficient. Test plan: [1] Run Breeding.t [2] Run Record.t [3] Add a nonexisting xslt file to one of your Z3950 targets. Search on that target and check if you see a error 'XSLT file not found'. The bonus is these error messages are now translatable as they are in the templates Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Awesome work all! Pushed to master for 18.11
Enhancement, not back porting to 18.05.x series.