ES /docs

Invalid Formula: Dentaku::AST::Multiplication has too many operands (given 3, expected 2)

Summary: Invalid Formula: Dentaku parse error logged at error level

결과#

Cupix::Util::FormulaParser.calculate! 의 rescue 체인을 좁혀 사용자 formula 문법 오류(Dentaku::Error, Dentaku::ZeroDivisionError)는 warn, 시스템 오류는 기존대로 error 로 분리 로깅. 응답/에러 코드/UX 는 변경 없음(400 + ARG10001 유지). Blind validator 1회 통과, 자동 PR 생성 완료.

Pull Requests#

Repo PR Branch
tesla https://dev.azure.com/cupix/tesla/_git/tesla/pullrequest/89277 feature/TSLA-13766

변경 내용#

tesla#

  • lib/cupix/util/formula_parser.rb: calculate!rescue Dentaku::Error, Dentaku::ZeroDivisionError => e; Cupix::Logger.warn(...) 절을 기존 rescue StandardError => error 앞에 삽입. Dentaku 계열 예외는 warn, 그 외는 기존 error 경로 유지. 두 절 모두 Cupix::Errors::Parameter(ARG10001) 재던짐(응답 동작 불변).
  • spec/lib/cupix/util/formula_parser_spec.rb: describe '#calculate!' 에 2개 context 추가 — (1) Dentaku::Error 경로('1 1' = ParseError)에서 warn 호출/error 미호출 검증, (2) 일반 StandardError 경로(evaluate! stub) 에서 error 호출/warn 미호출 회귀 검증.

별도 트랙 (본 PR 범위 외)#

  • 장기 개선 (프런트엔드 실시간 formula 문법 검증기): RCA 의 장기 개선 항목. 프런트엔드/UX 조율이 필요하므로 자동 code-fix 대상에서 제외. 사용자 입력 오류의 서버 왕복 자체를 줄이려면 별도 티켓 필요.

Cleanup#

bash
cd $REPOS_DIR/tesla
git worktree remove /home/ec2-user/error-sweeper/.worktrees/960b0fc9-ced0-474f-ac6e-2048444878d4/tesla