From: Matthias Braun Date: Wed, 31 Jan 2007 16:23:58 +0000 (+0000) Subject: more explanations when sprites failed to load X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3aaf6865cf5546bdfc81100d1182a772c7d6d685;p=supertux.git more explanations when sprites failed to load SVN-Revision: 4758 --- diff --git a/src/sprite/sprite_manager.cpp b/src/sprite/sprite_manager.cpp index 5b3744174..0878e62e7 100644 --- a/src/sprite/sprite_manager.cpp +++ b/src/sprite/sprite_manager.cpp @@ -69,7 +69,16 @@ SpriteData* SpriteManager::load(const std::string& filename) { lisp::Parser parser; - std::auto_ptr root (parser.parse(filename)); + std::auto_ptr root; + + try { + root.reset(parser.parse(filename)); + } catch(const std::exception& e) { + std::ostringstream msg; + msg << "Parse error when trying to load sprite '" << filename + << "': " << e.what() << "\n"; + throw std::runtime_error(msg.str()); + } const lisp::Lisp* sprite = root->get_lisp("supertux-sprite"); if(!sprite) {