ES /docs

Quote#schedule_apply! logs validation errors as ERROR — missing exception filtering

Validation: 79f45086-41ca-4b4c-8307-5dc5101d4294

Verdict: APPROVED#

Completeness#

Plan Item Status Evidence
Quote#apply!rescue Cupix::Errors::Billing 절 추가 (Parameter 뒤, StandardError 앞) PASS app/models/quote.rb: +100~+102줄에 rescue Cupix::Errors::Billing => e 절이 기존 rescue Cupix::Errors::Parameter (97줄) 와 rescue StandardError (기존 위치) 사이에 삽입됨
Cupix::Logger.warn(...) 로 로깅 후 raise e PASS app/models/quote.rb: +101줄 Cupix::Logger.warn("[Quote][#{number}] Quote application failed: #{e.message}") 및 +102줄 raise e
기존 rescue StandardError 블록 및 error 로깅 유지 PASS app/models/quote.rb: diff 상 기존 rescue StandardError => e / Cupix::Logger.error("[Quote][#{number}] Quote application failed: #{e.message}") 는 컨텍스트 라인으로 그대로 남아있음
Billing 경로에 대한 warn 검증 spec 추가 PASS spec/models/quote_spec.rb: +224~+248줄, expect(Cupix::Logger).to have_received(:warn).with(/\[Quote\]\[#{other.number}\] Quote application failed:/).at_least(:once)not_to have_received(:error) 확인
비-billing StandardError 경로가 여전히 error 로 로깅되는 회귀 방지 spec 유지 PASS spec/models/quote_spec.rb: +250~+257줄, check_appliable 를 stub 하여 StandardError raise 후 Cupix::Logger).to have_received(:error) 검증

Acceptance Criteria#

Criterion Status Evidence
rescue Cupix::Errors::Billing 추가 및 Cupix::Logger.warn 사용 PASS app/models/quote.rb +100~+101줄
기존 rescue StandardError + Cupix::Logger.error 유지 PASS app/models/quote.rb diff 하단 컨텍스트 라인에 그대로 존재 (변경 없음)
grep -n 'rescue Cupix::Errors::Billing' app/models/quote.rb 결과 1건 이상 PASS app/models/quote.rb +100줄에 정확히 1건 신규 추가됨
Billing 경로에 대한 expect(Cupix::Logger).to have_received(:warn) 존재 PASS spec/models/quote_spec.rb +244~+245줄
ruby -c 구문 오류 없음 PASS (정적 판독) diff 상 rescue/raise/end 구조가 균형 잡혀 있고 rescue 절 순서가 유효함. 런타임 실행 없이 검증 불가하나 문법상 이상 없음

Issues Found#

No blocking issues found.

Observations#

  • Rescue 절 순서(ParameterBillingStandardError)가 올바르게 유지되어 특정 예외가 먼저 잡히도록 보장됨.
  • Billing warn 로그는 class:/function:/module: 키워드 인자 없이 호출되는데, 인접한 Parameter 경로는 해당 키워드를 포함함. 로깅 메타데이터 일관성 측면에서 향후 정렬을 검토할 여지 있음 (비차단).
  • Spec 의 첫 번째 예시는 실제 팩토리와 apply 흐름에 의존하여 Cupix::Errors::Billing 을 자연스럽게 발생시키는 통합성 예제로, RCA 시나리오("Billable already has a scheduled quote") 를 정규식으로 매칭하여 견고함.
  • 두 번째 예시는 check_appliable 를 stub 하여 StandardError 경로만 재현 — Billing 클래스가 StandardError 를 상속할 경우에도 rescue 순서상 Billing 절이 먼저 매칭되므로 non-billing 회귀 커버리지가 유효함.