onHttpError method

Future<RetryAction> onHttpError(
  1. HttpResponse response,
  2. NodeSpec action,
  3. ActionContext context
)

Method used to handle Http errors. Conveniently placed in this class to facilitate overrides.

Implementation

Future<RetryAction> onHttpError(
    HttpResponse response, NodeSpec action, ActionContext context) async {
  if (response.statusCode == 401) {
    showErrorMessage("invalid_session_message");
  } else {
    showErrorMessage("communication_error_message");
  }
  return RetryAction(false);
}