diff --git a/CHANGELOG.md b/CHANGELOG.md index b6b0589d1..9254a5337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [9.3.1] + +- Includes exception class name in 500 error message + ## [9.3.0] ### Changes diff --git a/build.gradle b/build.gradle index 1a462ca04..022cf70b0 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ compileTestJava { options.encoding = "UTF-8" } // } //} -version = "9.3.0" +version = "9.3.1" repositories { diff --git a/src/main/java/io/supertokens/webserver/WebserverAPI.java b/src/main/java/io/supertokens/webserver/WebserverAPI.java index a8fc5795a..6533d267d 100644 --- a/src/main/java/io/supertokens/webserver/WebserverAPI.java +++ b/src/main/java/io/supertokens/webserver/WebserverAPI.java @@ -532,10 +532,10 @@ protected void service(HttpServletRequest req, HttpServletResponse resp) throws } else if (rootCause instanceof BadPermissionException) { sendTextResponse(403, rootCause.getMessage(), resp); } else { - sendTextResponse(500, rootCause.getMessage(), resp); + sendTextResponse(500, rootCause.toString(), resp); } } else { - sendTextResponse(500, e.getMessage(), resp); + sendTextResponse(500, e.toString(), resp); } } Logging.info(main, tenantIdentifier, "API ended: " + req.getRequestURI() + ". Method: " + req.getMethod(), diff --git a/src/test/java/io/supertokens/test/PathRouterTest.java b/src/test/java/io/supertokens/test/PathRouterTest.java index 677c404a0..cbce604ff 100644 --- a/src/test/java/io/supertokens/test/PathRouterTest.java +++ b/src/test/java/io/supertokens/test/PathRouterTest.java @@ -125,7 +125,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) fail(); } catch (HttpResponseException e) { assertEquals(500, e.statusCode); - assertEquals("Http error. Status Code: 500. Message: Test Exception", e.getMessage()); + assertEquals("Http error. Status Code: 500. Message: java.lang.RuntimeException: Test Exception", e.getMessage()); } } @@ -137,7 +137,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) fail(); } catch (HttpResponseException e) { assertEquals(500, e.statusCode); - assertEquals("Http error. Status Code: 500. Message: Runtime Exception", e.getMessage()); + assertEquals("Http error. Status Code: 500. Message: java.lang.RuntimeException: Runtime Exception", e.getMessage()); } } } diff --git a/src/test/java/io/supertokens/test/emailpassword/api/ImportUserWithPasswordHashAPITest.java b/src/test/java/io/supertokens/test/emailpassword/api/ImportUserWithPasswordHashAPITest.java index cbec01f4c..caa0d7c99 100644 --- a/src/test/java/io/supertokens/test/emailpassword/api/ImportUserWithPasswordHashAPITest.java +++ b/src/test/java/io/supertokens/test/emailpassword/api/ImportUserWithPasswordHashAPITest.java @@ -297,7 +297,7 @@ public void testImportingAUsesrFromFirebaseWithoutSettingTheSignerKey() throws E throw new Exception("Should not come here"); } catch (io.supertokens.test.httpRequest.HttpResponseException e) { assertTrue(e.statusCode == 500 - && e.getMessage().equals("Http error. Status Code: 500. Message: 'firebase_password_hashing_signer_key' cannot be null")); + && e.getMessage().equals("Http error. Status Code: 500. Message: java.lang.IllegalStateException: 'firebase_password_hashing_signer_key' cannot be null")); } process.kill(); @@ -388,7 +388,7 @@ public void testSigningInAUserWithFirebasePasswordHashWithoutSettingTheSignerKey throw new Exception("Should not come here"); } catch (io.supertokens.test.httpRequest.HttpResponseException e) { assertTrue(e.statusCode == 500 - && e.getMessage().equals("Http error. Status Code: 500. Message: 'firebase_password_hashing_signer_key' cannot be null")); + && e.getMessage().equals("Http error. Status Code: 500. Message: java.lang.IllegalStateException: 'firebase_password_hashing_signer_key' cannot be null")); } process.kill();