+// Deserializes value and handles errors
+static int deserialization_helper(lua_State *L, AreaStore *as,
+ std::istream &is)
+{
+ try {
+ as->deserialize(is);
+ } catch (const SerializationError &e) {
+ lua_pushboolean(L, false);
+ lua_pushstring(L, e.what());
+ return 2;
+ }
+
+ lua_pushboolean(L, true);
+ return 1;
+}
+