Error msg

This commit is contained in:
GregTCLTK 2020-02-07 01:35:12 +01:00
parent 96eb486661
commit c4ab4e085a

View file

@ -18,6 +18,7 @@ package com.bbn.hadder;
import com.bbn.hadder.core.Config; import com.bbn.hadder.core.Config;
import com.rethinkdb.RethinkDB; import com.rethinkdb.RethinkDB;
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;
@ -154,7 +155,12 @@ public class Rethink {
} }
// TODO // TODO
public boolean hasStarboardMessage(String message_id) { public boolean hasStarboardMessage(String message_id) {
return this.getByID("stars", message_id, "guild") != null; try {
this.getByID("stars", message_id, "guild");
return true;
} catch (ReqlNonExistenceError e) {
return false;
}
} }