throwError static method

dynamic throwError(
  1. int errorCode,
  2. ZDResponseCallback callback
)

Implementation

static throwError(int errorCode, ZDResponseCallback callback){
  String errorMessage;
  switch (errorCode){
    case 101:
      errorMessage = "No Network Connection";
      break;
    case 104:
      errorMessage = "No Data";
      break;
    default:
      errorMessage = "Server Exception";
  }

  callback.onError(errorMessage);
}