Skip to content

Commit 1d4fbf6

Browse files
authored
Catch/report JSONException
1 parent 4dfd18e commit 1d4fbf6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

blast/src/org/labkey/blast/model/BlastJob.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.apache.logging.log4j.Logger;
55
import org.apache.logging.log4j.LogManager;
66
import org.jetbrains.annotations.Nullable;
7+
import org.json.JSONException;
78
import org.json.JSONObject;
89
import org.labkey.api.data.Container;
910
import org.labkey.api.data.ContainerManager;
@@ -105,7 +106,14 @@ public void setParams(String params)
105106
if (params == null)
106107
_params = null;
107108

108-
_params = new HashMap<>(new JSONObject(params).toMap());
109+
try
110+
{
111+
_params = new HashMap<>(new JSONObject(params).toMap());
112+
}
113+
catch (JSONException e)
114+
{
115+
_log.error("Unable to parse BlastJob config for: " + _objectid + " in container: " + ContainerManager.getForId(_container).getPath() + ", was: " + _params);
116+
}
109117
}
110118

111119
public void addParam(String name, String value)

0 commit comments

Comments
 (0)