Skip to content

Commit

Permalink
Reduce modality error log to info (#20008)
Browse files Browse the repository at this point in the history
* Reduce modality error log to info

* Revert typo
  • Loading branch information
JunTaoLuo authored Dec 23, 2024
1 parent b02834c commit b53a1d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/vaos/app/services/vaos/v2/appointments_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ def set_modality(appointment)
modality = 'communityCare'
end

Rails.logger.error("VAOS appointment id #{appointment[:id]} modality cannot be determined.") if modality.nil?
Rails.logger.info("VAOS appointment id #{appointment[:id]} modality cannot be determined.") if modality.nil?

appointment[:modality] = modality
end
Expand Down
4 changes: 2 additions & 2 deletions modules/vaos/spec/services/v2/appointment_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1730,12 +1730,12 @@
end

it 'logs failure to determine modality' do
allow(Rails.logger).to receive(:error).at_least(:once)
allow(Rails.logger).to receive(:info).at_least(:once)
appt = FactoryBot.build(:appointment_form_v2, :va_proposed_valid_reason_code_text).attributes
appt[:kind] = 'none'
subject.send(:set_modality, appt)
expect(appt[:modality]).to be_nil
expect(Rails.logger).to have_received(:error).at_least(:once)
expect(Rails.logger).to have_received(:info).at_least(:once)
end

it 'requires appointment' do
Expand Down

0 comments on commit b53a1d9

Please sign in to comment.