O'Reilly logo

Learning Dart by Ivo Balbaert, Dzenan Ridjanovic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recognizing and catching errors and exceptions

As a good programmer, you test your app in all possible conditions. Dart defines a number of errors for those things that you should remedy in your code, such as CastError when a cast fails, or NoSuchMethodError when the class of the object on which the method is called does not have this method, and neither do any of its parent classes. All these are subclasses of the Error class, and you should code so that they do not occur. But when something unexpected occurs while running the app, and the code cannot cope with it, an Unhandled Exception occurs. Especially input values that are read in from the keyboard, a file, or a network connection can be dangerous. Suppose input is such a value that is supposed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required