registerOnError, unregisterOnError

Register a callback function listening for error events. The callback function receives an error code and message.

Demo

  • Register the error handler.
  • Unregister the error handler.

After the error handler has been registered, you can provoke errors:

  • Try opening a file which does not exist.
  • Try adding a comment while no model is open.
  • Error handling for a closed WebSocket connection can be demonstrated by shutting down the server. Before you try this, make sure the server is not in productive use.