diff src/luan/modules/TableLuan.java @ 1708:8d257d56dc42

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 04 Jul 2022 14:06:59 -0600
parents 19df8abc9805
children
line wrap: on
line diff
--- a/src/luan/modules/TableLuan.java	Mon Jul 04 12:40:59 2022 -0600
+++ b/src/luan/modules/TableLuan.java	Mon Jul 04 14:06:59 2022 -0600
@@ -39,7 +39,11 @@
 	public static Object remove(LuanTable list,int pos) throws LuanException {
 		if( list.getMetatable() != null )
 			throw new LuanException("can't remove from a table with a metatable");
-		return list.removeFromList(pos);
+		try {
+			return list.removeFromList(pos);
+		} catch(IndexOutOfBoundsException e) {
+			throw new LuanException("index out of bounds - index="+pos+" length="+list.rawLength());
+		}
 	}
 
 	private static interface LessThan {