인프런 커뮤니티 질문&답변
답변 1
1
좋은사람
지식공유자
def demo_bad_catch():
try:
raise ValueError('Represents a hidden bug, do not catch this')
raise Exception('This is the exception you expect to handle')
except Exception as error:
print('Caught this error: ' + repr(error))
>>> demo_bad_catch()
Caught this error: ValueError('Represents a hidden bug, do not catch this',)
위에 소스를 한 번 보세요~ 출력 가능합니다. Value 에러가 먼저 잡히겠죠?




