From e1f9ba435f8c0cca90f2d3df36e9aa82763e1da0 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Wed, 18 Dec 2013 18:17:26 -0500 Subject: Don't throw a error when writing JSON fails --- src/script/common/c_content.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/script/common') diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 8eb57ba41..cb5a92ae4 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -1106,26 +1106,26 @@ void get_json_value(lua_State *L, Json::Value &root, int index) if (keytype == LUA_TNUMBER) { lua_Number key = lua_tonumber(L, -1); if (roottype != Json::nullValue && roottype != Json::arrayValue) { - throw LuaError(NULL, "Can't mix array and object values in JSON"); + throw SerializationError("Can't mix array and object values in JSON"); } else if (key < 1) { - throw LuaError(NULL, "Can't use zero-based or negative indexes in JSON"); + throw SerializationError("Can't use zero-based or negative indexes in JSON"); } else if (floor(key) != key) { - throw LuaError(NULL, "Can't use indexes with a fractional part in JSON"); + throw SerializationError("Can't use indexes with a fractional part in JSON"); } root[(Json::ArrayIndex) key - 1] = value; } else if (keytype == LUA_TSTRING) { if (roottype != Json::nullValue && roottype != Json::objectValue) { - throw LuaError(NULL, "Can't mix array and object values in JSON"); + throw SerializationError("Can't mix array and object values in JSON"); } root[lua_tostring(L, -1)] = value; } else { - throw LuaError(NULL, "Lua key to convert to JSON is not a string or number"); + throw SerializationError("Lua key to convert to JSON is not a string or number"); } } } else if (type == LUA_TNIL) { root = Json::nullValue; } else { - throw LuaError(NULL, "Can only store booleans, numbers, strings, objects, arrays, and null in JSON"); + throw SerializationError("Can only store booleans, numbers, strings, objects, arrays, and null in JSON"); } lua_pop(L, 1); // Pop value } -- cgit v1.2.3