I am new to Ruby/ Ruby on Rails. I wrote the below code to get a boolean value from api. The API call failed and it went to the rescue block. But for some reason, it set the value to true. I don't understand how that happened.
@is_attached = OnDeck.api.check_is_attached(@decision.application_number, current_user)
Api call / client wrapper Code
def check_is_attached(app_number, user)
begin
client.check_is_attached(app_number, user.auth_token)
rescue OnDeckException::MerchantApiException => e
Rails.logger.error("Caught exception #{e} while calling check_mbs_attached for app_number : #{app_number}")
end
end