toErrorCode method

ErrorCode toErrorCode()

Implementation

ErrorCode toErrorCode() {
  switch (this) {
    case 'SubnetNotFound':
      return ErrorCode.subnetNotFound;
    case 'SecurityGroupNotFound':
      return ErrorCode.securityGroupNotFound;
    case 'EniLimitReached':
      return ErrorCode.eniLimitReached;
    case 'IpNotAvailable':
      return ErrorCode.ipNotAvailable;
    case 'AccessDenied':
      return ErrorCode.accessDenied;
    case 'OperationNotPermitted':
      return ErrorCode.operationNotPermitted;
    case 'VpcIdNotFound':
      return ErrorCode.vpcIdNotFound;
    case 'Unknown':
      return ErrorCode.unknown;
    case 'NodeCreationFailure':
      return ErrorCode.nodeCreationFailure;
    case 'PodEvictionFailure':
      return ErrorCode.podEvictionFailure;
    case 'InsufficientFreeAddresses':
      return ErrorCode.insufficientFreeAddresses;
    case 'ClusterUnreachable':
      return ErrorCode.clusterUnreachable;
    case 'InsufficientNumberOfReplicas':
      return ErrorCode.insufficientNumberOfReplicas;
    case 'ConfigurationConflict':
      return ErrorCode.configurationConflict;
  }
  throw Exception('$this is not known in enum ErrorCode');
}