Dart catch clause
Dart is an optional typed language. So the type of e is not required. you have to use the following syntax to catch only SomeException : try { // … } on SomeException catch(e) { //Handle exception of type SomeException } catch(e) { //Handle all other exceptions } See catch section of Dart: Up and … Read more