getErrorCode static method

String getErrorCode(
  1. ErrorCode code
)

Returns the error code string for an ErrorCode enum.

Implementation

static String getErrorCode(ErrorCode code) {
  switch (code) {
    case ErrorCode.invalidRequest:
      return "1001";
    case ErrorCode.genericError:
      return "1002";
  }
}