Skip to content

Running azure-cost without any arguments results in an exception #233

@HansDeMulder-VRB

Description

@HansDeMulder-VRB

When running the azure-cost cli without any arguments, an exception is shown. I personally would expect the help information to be shown.

$> azure-cost

# Output
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Spectre.Console.ExceptionFormatter.GetStackFrames(Exception ex, ExceptionSettings settings) in /_/src/Spectre.Console/Widgets/Exceptions/ExceptionFormatter.cs:line 46
   at Spectre.Console.ExceptionFormatter.GetException(Exception exception, ExceptionSettings settings) in /_/src/Spectre.Console/Widgets/Exceptions/ExceptionFormatter.cs:line 29
   at Spectre.Console.ExceptionFormatter.Format(Exception exception, ExceptionSettings settings) in /_/src/Spectre.Console/Widgets/Exceptions/ExceptionFormatter.cs:line 19
   at Spectre.Console.ExceptionExtensions.GetRenderable(Exception exception, ExceptionSettings settings) in /_/src/Spectre.Console/Extensions/ExceptionExtensions.cs:line 47
   at Spectre.Console.ExceptionExtensions.GetRenderable(Exception exception, ExceptionFormats format) in /_/src/Spectre.Console/Extensions/ExceptionExtensions.cs:line 22
   at Spectre.Console.AnsiConsoleExtensions.WriteException(IAnsiConsole console, Exception exception, ExceptionFormats format) in /_/src/Spectre.Console/Extensions/AnsiConsoleExtensions.Exceptions.cs:line 17
   at Spectre.Console.AnsiConsole.WriteException(Exception exception, ExceptionFormats format) in /_/src/Spectre.Console/AnsiConsole.Exceptions.cs:line 16
   at AzureCostCli.Commands.AccumulatedCost.AccumulatedCostCommand.ExecuteAsync(CommandContext context, AccumulatedCostSettings settings) in /home/runner/work/azure-cost-cli/azure-cost-cli/src/Commands/AccumulatedCost/AccumulatedCostCommand.cs:line 81
   at Spectre.Console.Cli.CommandExecutor.Execute(CommandTree leaf, CommandTree tree, CommandContext context, ITypeResolver resolver, IConfiguration configuration) in /_/src/Spectre.Console.Cli/Internal/CommandExecutor.cs:line 252

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions