SpriteManager::load(const std::string& filename)
{
lisp::Parser parser;
- std::auto_ptr<lisp::Lisp> root (parser.parse(filename));
+ std::auto_ptr<lisp::Lisp> 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) {