Skip to Content
Dart: Scalable Application Development
book

Dart: Scalable Application Development

by Davy Mitchell, Sergey Akopkokhyants, Ivo Balbaert
June 2017
Intermediate to advanced
873 pages
18h 9m
English
Packt Publishing
Content preview from Dart: Scalable Application Development

Zones

Often, a program generates an uncaught exception and terminates the execution. The commonly occurring exceptions in the program means that the code is broken and must be fixed. However, sometimes exceptions may happen due to errors in communication, hardware faults, and so on. The following is an example of the HTTP server, which is used to demonstrate this problem:

import 'dart:io';

main() {
  runServer();
}

runServer() {
  HttpServer
  .bind(InternetAddress.ANY_IP_V4, 8080)
  .then((server) {
    server.listen((HttpRequest request) {
      request.response.write('Hello, world!');
      request.response.close();
    });
  });
}

The code in the main function can be terminated due to uncaught errors that may happen in the runServer function. Termination of the program under ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

You might also like

Dart in Action

Dart in Action

Chris Buckett
Dart: Up and Running

Dart: Up and Running

Kathy Walrath, Seth Ladd

Publisher Resources

ISBN: 9781787288027