Tcl & Tk/확장 패키지 (Extension Package)
tcl_exceptions
ihmin
2025. 2. 17. 11:23
홈페이지: https://github.com/abstiles/tcl_exceptions/blob/master/exceptions.tcl
Python에서 영감을 받아 작성된 정교한 Tcl 예외 처리 확장 패키지입니다.
A TCL package to add more sophisticated (Python-inspired) exception handling.
# Example usage:
try {
# Code that may need cleanup
# and/or
# Code with potential errors
} catch -ex ExceptionType {
# ExceptionType handling code...
} catch -gl {Index*Error} {
# Code to handle e.g., IndexOutOfRangeError, IndexTypeError...
} catch -re {Bad(Arg|Data)Error} {
# Code to handle BadArgError or BadDataError...
} catch * {
# Code to catch anything not handled by the previous catch blocks...
} finally {
# Cleanup code that always executes
}