| 1 | // Aseprite |
|---|---|
| 2 | // Copyright (C) 2001-2015 David Capello |
| 3 | // |
| 4 | // This program is distributed under the terms of |
| 5 | // the End-User License Agreement for Aseprite. |
| 6 | |
| 7 | #ifdef HAVE_CONFIG_H |
| 8 | #include "config.h" |
| 9 | #endif |
| 10 | |
| 11 | #include "app/xml_exception.h" |
| 12 | |
| 13 | #include "tinyxml.h" |
| 14 | |
| 15 | #include <cstdio> |
| 16 | |
| 17 | namespace app { |
| 18 | |
| 19 | XmlException::XmlException(const TiXmlDocument* doc) throw() |
| 20 | { |
| 21 | try { |
| 22 | char buf[4096]; // TODO Overflow |
| 23 | |
| 24 | sprintf(buf, "Error in XML file '%s' (line %d, column %d)\nError %d: %s", |
| 25 | doc->Value(), doc->ErrorRow(), doc->ErrorCol(), |
| 26 | doc->ErrorId(), doc->ErrorDesc()); |
| 27 | |
| 28 | setMessage(buf); |
| 29 | } |
| 30 | catch (...) { |
| 31 | // No throw |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | } // namespace app |
| 36 |