File tree Expand file tree Collapse file tree
src/main/java/dev/openfga/sdk/api/configuration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ public class Configuration implements BaseConfiguration {
3636 private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.8.3" ;
3737 private static final Duration DEFAULT_READ_TIMEOUT = Duration .ofSeconds (10 );
3838 private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration .ofSeconds (10 );
39- private static final int DEFAULT_MAX_RETRIES = 15 ;
39+ private static final int DEFAULT_MAX_RETRIES = 3 ;
40+ private static final int MAX_ALLOWABLE_RETRIES = 15 ;
4041
4142 private String apiUrl ;
4243 private Credentials credentials ;
@@ -267,6 +268,13 @@ public Duration getConnectTimeout() {
267268 }
268269
269270 public Configuration maxRetries (int maxRetries ) {
271+ if (maxRetries < 0 ) {
272+ throw new IllegalArgumentException ("maxRetries must be non-negative" );
273+ }
274+ if (maxRetries > MAX_ALLOWABLE_RETRIES ) {
275+ throw new IllegalArgumentException (
276+ "maxRetries cannot exceed " + MAX_ALLOWABLE_RETRIES + " (maximum allowable retries)" );
277+ }
270278 this .maxRetries = maxRetries ;
271279 return this ;
272280 }
You can’t perform that action at this time.
0 commit comments