runWithConfig method

  1. @override
Future<void> runWithConfig(
  1. Configuration<StatusOption> commandConfig
)
override

Runs this command with prepared configuration (options). Subclasses should override this method.

Implementation

@override
Future<void> runWithConfig(
  final Configuration<StatusOption> commandConfig,
) async {
  final projectId = commandConfig.value(StatusOption.projectId);
  final inUtc = commandConfig.value(StatusOption.utc);

  try {
    await RuntimeStatusCommands.showRuntimeStatus(
      runner.serviceProvider.cloudApiClient,
      logger: logger,
      projectId: projectId,
      inUtc: inUtc,
    );
  } on CapsuleStatusUnavailableException {
    throw FailureException(
      error: 'Could not retrieve the podlet status for project "$projectId".',
      hint:
          'The status service is temporarily unavailable — '
          'try again shortly.',
    );
  } on Exception catch (e, s) {
    throw FailureException.nested(e, s, 'Failed to get the podlet status');
  }
}