getError static method

TonConnectError getError(
  1. SendTransactionErrorCodes errorCodes,
  2. String? message
)

Implementation

static TonConnectError getError(
    SendTransactionErrorCodes errorCodes, String? message) {
  switch (errorCodes) {
    case SendTransactionErrorCodes.unknownError:
      return UnknownError(message);
    case SendTransactionErrorCodes.badRequestError:
      return BadRequestError(message);
    case SendTransactionErrorCodes.unknownAppError:
      return UnknownAppError(message);
    case SendTransactionErrorCodes.userRejectsError:
      return UserRejectsError(message);
    default:
      return UnknownError(message);
  }
}