diff --git a/src/main/java/com/auth0/net/CustomRequest.java b/src/main/java/com/auth0/net/CustomRequest.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/auth0/net/CustomRequest.java
+++ b/src/main/java/com/auth0/net/CustomRequest.java
@@ -100,12 +100,11 @@ public class CustomRequest<T> extends BaseRequest<T> implements CustomizableRequ
     }
 
     protected Auth0Exception createResponseException(Response response) {
-        if (response.code() == STATUS_CODE_TOO_MANY_REQUEST) {
-            return createRateLimitException(response);
-        }
-
         String payload = null;
         try (ResponseBody body = response.body()) {
+            if (response.code() == STATUS_CODE_TOO_MANY_REQUEST) {
+                return createRateLimitException(response);
+            }
             payload = body.string();
             MapType mapType = mapper.getTypeFactory().constructMapType(HashMap.class, String.class, Object.class);
             Map<String, Object> values = mapper.readValue(payload, mapType);
Closing response body on RateLimitException