Skip to content

Commit

Permalink
Throw exception if policy engine is null
Browse files Browse the repository at this point in the history
This will allow lastrefesh time to reflect the fact
that policies are not yet updated
  • Loading branch information
krsoninikhil committed Jan 14, 2025
1 parent b3f6392 commit 55d6e7c
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ public void setPolicies(ServicePolicies policies) {
if (defaultSvcPolicies == null) {
LOG.error("Could not get default Service Policies. Keeping old policy-engine! This is a FATAL error as the old policy-engine is null!");
isNewEngineNeeded = false;
throw new RuntimeException("PolicyRefresher("+policies.getServiceName()+").setPolicies: fetched service policies contains no policies or delta and current policy engine is null");
} else {
defaultSvcPolicies.setPolicyVersion(policies.getPolicyVersion());
policies = defaultSvcPolicies;
Expand Down

0 comments on commit 55d6e7c

Please sign in to comment.