X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsprite%2Fsprite_manager.cpp;h=f1de683d85027601f3c40dc7b78b034dc2ca380a;hb=198f758764fff064a47630b5d0f1e3d6aabe95a8;hp=5b3744174e4ead05d114a056dcc9fa1a03cb8bd4;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/sprite/sprite_manager.cpp b/src/sprite/sprite_manager.cpp index 5b3744174..f1de683d8 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)); + const lisp::Lisp* root; + + try { + root = 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) {