mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 12:44:53 +00:00
Improve error reporting in gen utility when an invalid XML is used
This commit is contained in:
parent
8de18946f8
commit
af0267de03
@ -1,5 +1,5 @@
|
|||||||
// Aseprite Code Generator
|
// 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.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// 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"));
|
base::FileHandle inputFile(base::open_file(inputFilename, "rb"));
|
||||||
doc = new TiXmlDocument();
|
doc = new TiXmlDocument();
|
||||||
doc->SetValue(inputFilename.c_str());
|
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");
|
throw std::runtime_error("invalid input file");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc) {
|
if (doc) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user