From 8841800f9a360468964d95466b94e0a3cb98d4b2 Mon Sep 17 00:00:00 2001 From: Aaron McConnell Date: Wed, 31 Jul 2024 11:10:13 -0400 Subject: [PATCH] Handle the case where the code object in the response is not an integer --- duo-client/src/main/java/com/duosecurity/client/Http.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duo-client/src/main/java/com/duosecurity/client/Http.java b/duo-client/src/main/java/com/duosecurity/client/Http.java index 23a7d7f..23ed4b0 100644 --- a/duo-client/src/main/java/com/duosecurity/client/Http.java +++ b/duo-client/src/main/java/com/duosecurity/client/Http.java @@ -127,7 +127,7 @@ public Object executeJSONRequest() throws Exception { JSONObject result = new JSONObject(executeRequestRaw()); if (!result.getString("stat").equals("OK")) { throw new Exception("Duo error code (" - + result.getInt("code") + + result.get("code").toString() + "): " + result.getString("message")); }