diff options
| author | John Hurst <jhurst@cinecert.com> | 2021-08-26 20:44:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-26 20:44:42 -0700 |
| commit | 1f8506fd1076926c1b9c15587b8c7dca707e2c37 (patch) | |
| tree | 70e8868c8f29a840da8f8620d124d5498f26e251 /src/KM_xml.cpp | |
| parent | ef5881232511e629b1ff18e4d2f5323e3e6c1814 (diff) | |
| parent | 6b438cfc1d278be1740ac07eff7cc956143e193d (diff) | |
Merge pull request #8 from DolbyLaboratories/dolby/atmos_storage/asdcplib_integration/add_km_logs
Add KM logs and remove semicolon from pre-processor directive
Diffstat (limited to 'src/KM_xml.cpp')
| -rw-r--r-- | src/KM_xml.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/KM_xml.cpp b/src/KM_xml.cpp index 73ff8b5..9c45cde 100644 --- a/src/KM_xml.cpp +++ b/src/KM_xml.cpp @@ -613,6 +613,9 @@ Kumu::XMLElement::ParseFirstFromString(const char* document, ui32_t doc_len) if ( ! XML_Parse(Parser, document, doc_len, 1) ) { + DefaultLogSink().Error("XML Parse error on line %d: %s\n", + XML_GetCurrentLineNumber(Parser), + XML_ErrorString(XML_GetErrorCode(Parser))); XML_ParserFree(Parser); return false; } @@ -1023,8 +1026,23 @@ Kumu::XMLElement::ParseFirstFromString(const char* document, ui32_t doc_len) ++errorCount; } } + catch (const XMLException& e) + { + char* message = XMLString::transcode(e.getMessage()); + DefaultLogSink().Error("Parser error: %s\n", message); + XMLString::release(&message); + errorCount++; + } + catch (const SAXParseException& e) + { + char* message = XMLString::transcode(e.getMessage()); + DefaultLogSink().Error("Parser error: %s at line %d\n", message, e.getLineNumber()); + XMLString::release(&message); + errorCount++; + } catch (...) { + DefaultLogSink().Error("Unexpected XML parser error\n"); errorCount++; } |
