errorMessage method

String? errorMessage(
  1. dynamic exception
)

Implementation

String? errorMessage(var exception) {
  switch (exception.runtimeType) {
    case AtClientException:
      return 'Unable to perform this action. Please try again.';
    case UnAuthenticatedException:
      return 'Unable to authenticate. Please try again.';
    case NoSuchMethodError:
      return 'Failed in processing. Please try again.';
    case AtConnectException:
      return 'Unable to connect server. Please try again later.';
    case AtIOException:
      return 'Unable to perform read/write operation. Please try again.';
    case AtServerException:
      return 'Unable to activate server. Please contact admin.';
    case SecondaryNotFoundException:
      return 'Server is unavailable. Please try again later.';
    case SecondaryConnectException:
      return 'Unable to connect. Please check with network connection and try again.';
    case InvalidAtSignException:
      return 'Invalid atsign is provided. Please contact admin.';
    case String:
      return exception;
    case ResponseTimeOutException:
      return 'Server response timed out!\nPlease check your network connection and try again. Contact support@atsign.com if the issue still persists.';
    default:
      return 'Failed while loading\n please reopen the screen again.';
  }
}