Logging1 VIII. Agent Loop + Tool Dispatcher 다음 단계인 예외 처리(Exception), 재시도(Retry), Logging 스터디 # 1. KeyError — 딕셔너리에 없는 키를 찾았을 때 # def get_units(record): # return record["units"] # get_units({"sku":"51001"}) # 결과: Exception has occurred: KeyError 'units' #-------- 2. try / except / else / finally def to_int(value): try: number = int(value) except ValueError: print(f" {value!r}을 숫자로 변환할 수 없습니다.") return None exce.. 2026. 8. 23. 이전 1 다음 반응형