summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-01-24 14:55:30 +0000
committerGreg Roach <fisharebest@gmail.com>2015-01-24 14:55:30 +0000
commit1258cf57f47e52e408c3dcc0893c605b5155d301 (patch)
tree3c41b0e13675f63ef5cdb6f2481d98742575061c /library
parent52831beaf68187b60d7e790fc1521c906deb8a54 (diff)
downloadwebtrees-1258cf57f47e52e408c3dcc0893c605b5155d301.tar.gz
webtrees-1258cf57f47e52e408c3dcc0893c605b5155d301.tar.bz2
webtrees-1258cf57f47e52e408c3dcc0893c605b5155d301.zip
Improve error handling in report engine
Diffstat (limited to 'library')
-rw-r--r--library/WT/Report/Base.php11
1 files changed, 2 insertions, 9 deletions
diff --git a/library/WT/Report/Base.php b/library/WT/Report/Base.php
index 5374d0958c..0d3b4dd9b1 100644
--- a/library/WT/Report/Base.php
+++ b/library/WT/Report/Base.php
@@ -1536,9 +1536,7 @@ function varStartHandler($attrs) {
global $desc, $fact, $vars;
if (empty($attrs['var'])) {
- die("<strong>REPORT ERROR var: </strong> The attribute \"var=\" is missing or not set in the XML file on line: " . xml_get_current_line_number(
- $parser
- ));
+ throw new DomainException('REPORT ERROR var: The attribute "var=" is missing or not set in the XML file on line: ' . xml_get_current_line_number($parser));
}
$var = $attrs['var'];
@@ -2903,12 +2901,7 @@ function relativesEndHandler() {
xml_set_character_data_handler($repeat_parser, "characterData");
if (!xml_parse($repeat_parser, $reportxml, true)) {
- printf(
- $reportxml . "\nRelativesEHandler XML error: %s at line %d",
- xml_error_string(xml_get_error_code($repeat_parser)),
- xml_get_current_line_number($repeat_parser)
- );
- exit;
+ throw new DomainException("RelativesEHandler XML error: %s at line %d", xml_error_string(xml_get_error_code($repeat_parser)), xml_get_current_line_number($repeat_parser));
}
xml_parser_free($repeat_parser);
}