Skip to content

Commit 6866b51

Browse files
jsalaberCopilot
andauthored
Update lib/devcycle-ruby-server-sdk/api/client.rb
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 96a17aa commit 6866b51

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/devcycle-ruby-server-sdk/api/client.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,11 @@ def variable_with_http_info(key, user, default, opts = {})
331331
end
332332
return data
333333
rescue ApiError => error
334-
eval = { reason: DevCycle::EVAL_REASONS::DEFAULT, details: DevCycle::DEFAULT_REASON_DETAILS::MISSING_VARIABLE }
335-
if error.code != 404
334+
if error.code == 404
335+
eval = { reason: DevCycle::EVAL_REASONS::DEFAULT, details: DevCycle::DEFAULT_REASON_DETAILS::MISSING_VARIABLE }
336+
else
336337
@api_client.config.logger.error("Failed to retrieve variable value: #{error.message}")
337-
eval[:details] = DevCycle::DEFAULT_REASON_DETAILS::ERROR
338+
eval = { reason: DevCycle::EVAL_REASONS::DEFAULT, details: DevCycle::DEFAULT_REASON_DETAILS::ERROR }
338339
end
339340

340341
return Variable.new(key: key, value: default, isDefaulted: true, eval: eval)

0 commit comments

Comments
 (0)