public interface FailureCallback<T>

Known subtypesCallback, CallbackAdapter

Simple interface that allows asynchronous code to perform a parameterized callback in a similar way to GWT’s callback interface. This is the base interface for com.codename1.util.Callback where the logic is broken down to single method interfaces so Java 8 lambdas can be used.

Methods

public abstract void onError(Object sender, Throwable err, int errorCode, String errorMessage)Invoked when the async method throws an exception

Method details

onError

public abstract void onError(Object sender, Throwable err, int errorCode, String errorMessage)
Invoked when the async method throws an exception

Parameters

sender Object
the source of the error e.g. connection request that triggered the error, could be null
err Throwable
in case of an error triggered by an exception
errorCode int
if applicable e.g. with http error codes, -1 for unknown
errorMessage String
if applicable a user displayable message (can be null)