[KEYCLOAK-4769] - Better error message when resource has no or invalid uri
This commit is contained in:
parent
80a80512ea
commit
70a3dd1e4a
1 changed files with 8 additions and 1 deletions
|
@ -220,7 +220,14 @@ public class PolicyEnforcer {
|
|||
|
||||
pathConfig.setId(resourceDescription.getId());
|
||||
pathConfig.setName(resourceDescription.getName());
|
||||
pathConfig.setPath(resourceDescription.getUri());
|
||||
|
||||
String uri = resourceDescription.getUri();
|
||||
|
||||
if (uri == null || "".equals(uri.trim())) {
|
||||
throw new RuntimeException("Failed to configure paths. Resource [" + resourceDescription.getName() + "] has an invalid or empty URI [" + uri + "].");
|
||||
}
|
||||
|
||||
pathConfig.setPath(uri);
|
||||
|
||||
List<String> scopeNames = new ArrayList<>();
|
||||
|
||||
|
|
Loading…
Reference in a new issue