Skip to content

Commit

Permalink
Fix wrong return value of get_value_details() in case config JSON is …
Browse files Browse the repository at this point in the history
…not present (#27)
  • Loading branch information
adams85 authored Jun 21, 2023
1 parent af91eb9 commit 83462b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/configcat/configcatclient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ def get_value_details(key, default_value, user = nil)
if settings.nil?
message = "Config JSON is not present when evaluating setting '#{key}'. Returning the `default_value` parameter that you specified in your application: '#{default_value}'."
@log.error(1000, message)
@hooks.invoke_on_flag_evaluated(EvaluationDetails.from_error(key, default_value, error: message))
return default_value
details = EvaluationDetails.from_error(key, default_value, error: message)
@hooks.invoke_on_flag_evaluated(details)
return details
end
details = _evaluate(key, user, default_value, nil, settings, fetch_time)
return details
Expand Down

0 comments on commit 83462b9

Please sign in to comment.