handleCrudError method

void handleCrudError(
  1. DioException dioException,
  2. GeneralCallback callback
)

Implementation

void handleCrudError(
  DioException dioException,
  GeneralCallback<dynamic> callback,
) {
  if (dioException.isNotPermission) {
    callback.onError(
      GeneralResponse(
        statusCode: notPermission,
        message: ApLocalizations.current.noPermissionHint,
      ),
    );
  } else if (dioException.isNotFoundAnnouncement) {
    callback.onError(
      GeneralResponse(
        statusCode: notPermission,
        message: ApLocalizations.current.notFoundData,
      ),
    );
  } else {
    callback.onFailure(dioException);
  }
}