statusName static method

String statusName(
  1. int code
)

Canonical status name (CODE_N for unknown codes).

Implementation

static String statusName(int code) {
  switch (code) {
    case codeOk:
      return 'OK';
    case codeCancelled:
      return 'CANCELLED';
    case codeUnknown:
      return 'UNKNOWN';
    case codeInvalidArgument:
      return 'INVALID-ARGUMENT';
    case codeDeadlineExceeded:
      return 'DEADLINE-EXCEEDED';
    case codeNotFound:
      return 'NOT-FOUND';
    case codeAlreadyExists:
      return 'ALREADY-EXISTS';
    case codePermissionDenied:
      return 'PERMISSION-DENIED';
    case codeResourceExhausted:
      return 'RESOURCE-EXHAUSTED';
    case codeFailedPrecondition:
      return 'FAILED-PRECONDITION';
    case codeAborted:
      return 'ABORTED';
    case codeOutOfRange:
      return 'OUT-OF-RANGE';
    case codeUnimplemented:
      return 'UNIMPLEMENTED';
    case codeInternal:
      return 'INTERNAL';
    case codeUnavailable:
      return 'UNAVAILABLE';
    case codeDataLoss:
      return 'DATA-LOSS';
    case codeUnauthenticated:
      return 'UNAUTHENTICATED';
    default:
      return 'CODE_$code';
  }
}