executeCommand method

Future<String?> executeCommand(
  1. String atCommand, {
  2. bool auth = false,
})

Implementation

Future<String?> executeCommand(String atCommand, {bool auth = false}) async {
  if (atCommand.length > _preference.maxDataSize) {
    throw BufferOverFlowException(
        'The length of value exceeds the maximum allowed length. Maximum buffer size is ${_preference.maxDataSize} bytes. Found ${atCommand.length} bytes');
  }
  try {
    String? verbResult;
    verbResult = await atLookUp.executeCommand(atCommand, auth: auth);
    return verbResult;
  } on AtException catch (e) {
    e.stack(AtChainedException(Intent.fetchData,
        ExceptionScenario.remoteVerbExecutionFailed, e.message));
    rethrow;
  } on AtLookUpException catch (e) {
    var exception = AtExceptionUtils.get(e.errorCode!, e.errorMessage!);
    throw exception
      ..stack(AtChainedException(Intent.fetchData,
          ExceptionScenario.remoteVerbExecutionFailed, exception.message));
  }
}