Skip to content

Commit 380b177

Browse files
committed
throw derived exception to invoke error hook with expected flow
Signed-off-by: Kavindu Dodanduwa <[email protected]>
1 parent 1ca84c0 commit 380b177

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/dev/openfeature/sdk/OpenFeatureClient.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ private <T> FlagEvaluationDetails<T> evaluateFlag(FlagValueType type, String key
127127

128128
details = FlagEvaluationDetails.from(providerEval, key);
129129
if (details.getErrorCode() != null) {
130-
Exception e = ExceptionUtils.instantiateErrorByErrorCode(details.getErrorCode(),
131-
details.getErrorMessage());
132-
hookSupport.errorHooks(type, hookCtx, e, mergedHooks, hints);
130+
throw ExceptionUtils.instantiateErrorByErrorCode(details.getErrorCode(), details.getErrorMessage());
133131
} else {
134132
hookSupport.afterHooks(type, hookCtx, details, mergedHooks, hints);
135133
}

0 commit comments

Comments
 (0)