Skip to content

Instantly share code, notes, and snippets.

@nero-angela
Last active June 27, 2025 14:02
Show Gist options
  • Save nero-angela/1f1e1a16f764ec917aca662cdaa7b99a to your computer and use it in GitHub Desktop.
Save nero-angela/1f1e1a16f764ec917aca662cdaa7b99a to your computer and use it in GitHub Desktop.
dartTutorialTryOnCatch2
/// Copyright 2022. ⓒ DevStory.co.kr All rights reserved.
void main() {
try {
print("1. start");
assert(false); // AssertionError 발생
print("2. finish"); // 에러가 없는 경우 실행
} on UnsupportedError catch (e) {
print("3. UnsupportedError 에러 : ${e.runtimeType}"); // UnsupportedError 담당
} catch (e) {
print("4. 기타 에러 : ${e.runtimeType}"); // 기타 에러
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment