MI-DPLA / combine

Combine /kämˌbīn/ - Metadata Aggregator Platform
MIT License
26 stars 11 forks source link

pyxslt errors saved to document, not errors #176

Closed ghukill closed 6 years ago

ghukill commented 6 years ago

If pyjxslt has an error, it does not save to error, but instead to document for a Record. See the following example, where record 768 is the input record for 1018:

mysql> select document,error from core_record where id = 768;
+----------+-------------------------------------------------------------------------------------------------------------------------+
| document | error                                                                                                                   |
+----------+-------------------------------------------------------------------------------------------------------------------------+
|          | Could not parse record XML: Namespace prefix xl for href on note is not defined, line 53, column 47 (<string>, line 53) |
+----------+-------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select document,error from core_record where id = 1018;
+---------------------------------------------------------------------------------------------------------------------+-------+
| document                                                                                                            | error |
+---------------------------------------------------------------------------------------------------------------------+-------+
| ERROR: Transformer exception: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file. |       |
+---------------------------------------------------------------------------------------------------------------------+-------+
1 row in set (0.01 sec)
ghukill commented 6 years ago

Fixed: attempting XML parse of results, catching exceptions and sending to error column