Created
January 19, 2012 17:27
-
-
Save hacklschorsch/1641340 to your computer and use it in GitHub Desktop.
Patch to Zend Framework 1.11.4 to add filename to exception description when TMX parsing fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: library/Zend/Translate/Adapter/Tmx.php | |
=================================================================== | |
--- library/Zend/Translate/Adapter/Tmx.php (revision 3015) | |
+++ library/Zend/Translate/Adapter/Tmx.php (working copy) | |
@@ -74,9 +74,10 @@ | |
xml_set_character_data_handler($this->_file, "_contentElement"); | |
if (!xml_parse($this->_file, file_get_contents($filename))) { | |
- $ex = sprintf('XML error: %s at line %d', | |
+ $ex = sprintf('XML error: %s at line %d of file %s', | |
xml_error_string(xml_get_error_code($this->_file)), | |
- xml_get_current_line_number($this->_file)); | |
+ xml_get_current_line_number($this->_file), | |
+ $filename); | |
xml_parser_free($this->_file); | |
require_once 'Zend/Translate/Exception.php'; | |
throw new Zend_Translate_Exception($ex); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment