Created
March 6, 2021 10:27
-
-
Save jeovazero/0734aa7f261d184318f5e4d99c0028c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jeotario's academy | |
void exceptional() { | |
throw Exception('hi'); | |
} | |
void hello() { | |
throw 'Hello Friend'; | |
} | |
void err() { | |
throw Error(); | |
} | |
void unimplemented() { | |
throw UnimplementedError(); | |
} | |
void myException() { | |
throw MyException(2, 'hi exception'); | |
} | |
class MyException implements Exception { | |
int line; | |
String msg; | |
MyException(this.line, this.msg); | |
} | |
void main() { | |
try { | |
myException(); | |
} on MyException catch (e) { | |
print('line ${e.line} msg ${e.msg}'); | |
rethrow; | |
} catch (e) { | |
print('err'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment