TransactionError constructor

TransactionError(
  1. dynamic message,
  2. int status, {
  3. Map? detail,
})

Implementation

TransactionError(dynamic message, int status, {Map? detail}) : super() {
  switch (status) {
    case 408:
      errorType = TransactionErrorType.Timeout;
      break;
    case 500:
      errorType = TransactionErrorType.NotFound;
      break;
    default:
      errorType = TransactionErrorType.NetworkError;
      break;
  }
  throw {
    "message": Error.safeToString(message),
    "status": errorType,
    "detail": detail
  };
}