0

Quick question about Codename One. How would I handle a Connection Refused error? I have all the response listeners and they are overridden in the ConnectionRequest object, but when a connection refused error occurs it isn't going through my code and the application crashes. Many Thanks.

2 Answers2

0

You can override one of the error methods in ConnectionRequest to handle it for a specific connection e.g. handleIOException.

To do this globally you can use NetworkManager's addErrorListener, just make sure to invoke consume() on the event object so it won't propagate onwards.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
0

The problem here was that setFailSilently() was set to true, when it needed to be false. This is why it did not fire properly.