Skip to content

Commit 48f81ee

Browse files
authored
use IllegalArgumentException instead (#10745)
1 parent 4f2b5ee commit 48f81ee

30 files changed

Lines changed: 30 additions & 30 deletions

File tree

modules/openapi-generator/src/main/resources/Java/ServerConfiguration.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class ServerConfiguration {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public String URL(Map<String, String> variables) {
3939
if (variables != null && variables.containsKey(name)) {
4040
value = variables.get(name);
4141
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
42-
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
42+
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
4343
}
4444
}
4545
url = url.replaceAll("\\{" + name + "\\}", value);

0 commit comments

Comments
 (0)