Skip to content

Commit

Permalink
Update JSONException type to RuntimeException
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksgata committed Sep 14, 2022
1 parent 7d7ddde commit ac32131
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/indi/eiriksgata/dice/reply/CustomText.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import indi.eiriksgata.dice.utlis.VersionUtils;
import org.apache.commons.lang3.RandomUtils;
Expand Down Expand Up @@ -71,7 +70,7 @@ public static String getText(String key, Object... value) {
try {
JSONArray jsonArray = customText.getJSONArray(key);
jsonString = jsonArray.getString(RandomUtils.nextInt(0, jsonArray.size()));
} catch (JSONException e) {
} catch (RuntimeException e) {
jsonString = customText.getString(key);
}
return MessageFormat.format(jsonString, value);
Expand Down

0 comments on commit ac32131

Please sign in to comment.