Search in sources :

Example 1 with CancelledException

use of sugar.free.sightparser.error.CancelledException in project SightRemote by TebbeUbben.

the class StatusActivity method onError.

@Override
public void onError(Exception e) {
    if (!(e instanceof CancelledException) && !(e instanceof DisconnectedError)) {
        Snackbar snackbar = Snackbar.make(getRootView(), R.string.error, Snackbar.LENGTH_INDEFINITE);
        snackbar.setAction(R.string.retry, view -> taskRunnerRunnable.run());
        showSnackbar(snackbar);
        CrashlyticsUtil.logExceptionWithCallStackTrace(e);
    }
}
Also used : CancelledException(sugar.free.sightparser.error.CancelledException) DisconnectedError(sugar.free.sightparser.error.DisconnectedError) Snackbar(android.support.design.widget.Snackbar)

Example 2 with CancelledException

use of sugar.free.sightparser.error.CancelledException in project SightRemote by TebbeUbben.

the class TaskRunner method cancel.

public void cancel() {
    if (resultCallback != null) {
        cancelled = true;
        active = false;
        messageCallback.onError(new CancelledException());
    }
}
Also used : CancelledException(sugar.free.sightparser.error.CancelledException)

Aggregations

CancelledException (sugar.free.sightparser.error.CancelledException)2 Snackbar (android.support.design.widget.Snackbar)1 DisconnectedError (sugar.free.sightparser.error.DisconnectedError)1