[aseprite] 16/128: Improve error reporting in gen utility when an invalid XML is used
Tobias Hansen
thansen at moszumanska.debian.org
Mon May 9 21:24:18 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit af0267de0391d6703d03b2ec7fe2c8e932923b81
Author: David Capello <davidcapello at gmail.com>
Date: Mon Apr 18 19:10:10 2016 -0300
Improve error reporting in gen utility when an invalid XML is used
---
src/gen/gen.cpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/gen/gen.cpp b/src/gen/gen.cpp
index 557e926..3d0bcab 100644
--- a/src/gen/gen.cpp
+++ b/src/gen/gen.cpp
@@ -1,5 +1,5 @@
// Aseprite Code Generator
-// Copyright (c) 2014, 2015 David Capello
+// Copyright (c) 2014-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@@ -35,8 +35,15 @@ static void run(int argc, const char* argv[])
base::FileHandle inputFile(base::open_file(inputFilename, "rb"));
doc = new TiXmlDocument();
doc->SetValue(inputFilename.c_str());
- if (!doc->LoadFile(inputFile.get()))
+ if (!doc->LoadFile(inputFile.get())) {
+ std::cerr << doc->Value() << ":"
+ << doc->ErrorRow() << ":"
+ << doc->ErrorCol() << ": "
+ << "error " << doc->ErrorId() << ": "
+ << doc->ErrorDesc() << "\n";
+
throw std::runtime_error("invalid input file");
+ }
}
if (doc) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list