파이썬/예외 처리
파이썬 예외 처리
코린이도이
2020. 11. 4. 16:38
예외의 종류
프로그래밍 언어의 오류
-
구문 오류(syntax Error)
-
프로그램 실행 전에 발생하는 오류
-
이클립스, 파이참 등 통합개발환경 도구에서는 자동으로 실행 전에 오류를 체크함
-
-
논리적 오류(Logical Error) 혹은 런타임 오류(Runtime Error)
-
프로그램 실행 중에 발생하는 오류
- 문법적으로 틀린 것이 없으므로, 즉시 인식되지 않지만 의도치 않은 결과를 초래할 수 있음
-
파이썬 내장 예외 종류
Built-in Exceptions — Python 3.9.0 documentation
Built-in Exceptions In Python, all exceptions must be instances of a class that derives from BaseException. In a try statement with an except clause that mentions a particular class, that clause also handles any exception classes derived from that class (b
docs.python.org
- StopIteration, ImportError, NameError, SyntaxError 등
- 계층 구조로 이루어져 있음