Skip to content

Commit

Permalink
Refactor getConfigFieldsInfo method in Start and PostgreSQLConfig cla…
Browse files Browse the repository at this point in the history
…sses
  • Loading branch information
prateek3255 committed Feb 23, 2024
1 parent dedf48a commit 6605a5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/supertokens/storage/postgresql/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,7 @@ public Set<String> getValidFieldsInConfig() {
}

@Override
public ArrayList<ConfigFieldInfo> getConfigFieldsInfo() throws InvalidConfigException {
public ArrayList<ConfigFieldInfo> getConfigFieldsInfo() {
return PostgreSQLConfig.getConfigFieldsInfo();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static Set<String> getValidFields() {
return validFields;
}

public static ArrayList<ConfigFieldInfo> getConfigFieldsInfo() throws InvalidConfigException {
public static ArrayList<ConfigFieldInfo> getConfigFieldsInfo() {
ArrayList<ConfigFieldInfo> result = new ArrayList<ConfigFieldInfo>();

for (String fieldId : PostgreSQLConfig.getValidFields()) {
Expand All @@ -185,10 +185,8 @@ public static ArrayList<ConfigFieldInfo> getConfigFieldsInfo() throws InvalidCon
type = "boolean";
} else if (fieldType == int.class || fieldType == long.class || fieldType == Integer.class) {
type = "number";
}

if (type == null) {
throw new InvalidConfigException("Unsupported field type: " + fieldType.getName());
} else {
throw new RuntimeException("Unknown field type " + fieldType.getName());
}

result.add(new ConfigFieldInfo(name, description, isDifferentAcrossTenants, type));
Expand Down

0 comments on commit 6605a5d

Please sign in to comment.