chore(util/lua_list): improve error message in table_to_list aux function

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-05-12 12:58:10 -07:00
parent 1244a951f2
commit ad2b1d0d91

View file

@ -6,6 +6,7 @@ Author: Leonardo de Moura
*/
#pragma once
#include "util/list.h"
#include "util/sstream.h"
namespace lean {
/** \brief Convert a Lua table into a list<T> */
@ -21,7 +22,7 @@ list<T> table_to_list(lua_State * L, int idx, Proc const & to_value) {
}
return r;
} else {
throw exception("invalid argument, lua table expected");
throw exception(sstream() << "arg #" << idx << " must be a lua table");
}
}