Implement bad fix
This commit is contained in:
parent
cd171804f1
commit
6ffb0a2d99
1 changed files with 7 additions and 1 deletions
|
|
@ -22,6 +22,7 @@ import com.rethinkdb.gen.exc.ReqlNonExistenceError;
|
||||||
import com.rethinkdb.gen.exc.ReqlOpFailedError;
|
import com.rethinkdb.gen.exc.ReqlOpFailedError;
|
||||||
import com.rethinkdb.net.Connection;
|
import com.rethinkdb.net.Connection;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
@ -78,7 +79,12 @@ public class Rethink {
|
||||||
|
|
||||||
public JSONObject getObjectByID(String table, String id) {
|
public JSONObject getObjectByID(String table, String id) {
|
||||||
String response = r.table(table).get(id).toJson().run(conn);
|
String response = r.table(table).get(id).toJson().run(conn);
|
||||||
return new JSONObject(response);
|
try {
|
||||||
|
return new JSONObject(response);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
System.out.println(response);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insert(String table, Object object) {
|
public void insert(String table, Object object) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue