stride3d/stride · info · InvalidOperationException

Test crash from 'stride crash test'.

Error message

Test crash from 'stride crash test'.

What it means

This is a deliberate exception thrown by the hidden `stride crash test` subcommand. It exists solely to exercise the crash-report pipeline (store, consent prompt, send) end to end without a real bug. It is not a malfunction of the library.

Solutions

  1. No fix required — this crash is intentional; confirm the crash report was stored and the consent/send flow behaved as expected.
  2. If you hit this accidentally, simply do not run `stride crash test`; it is hidden and for pipeline testing only.
Defensive patterns

Strategy: try-catch

Try / catch

try { await command.InvokeAsync("crash test"); }
catch (InvalidOperationException ex) when (ex.Message.Contains("Test crash from")) {
    // expected: intentional pipeline test crash; assert report stored/sent
}

Prevention

When it happens

Trigger: Running `stride crash test` on the command line; the hidden test command's action unconditionally throws InvalidOperationException.

Common situations: Developers or QA validating crash reporting works in headless tools; someone discovering the hidden command via help/autocomplete and running it unknowingly.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/a7f1ac1e020dce40. Report an issue: GitHub.

Appendix: source

Thrown at sources/launcher/Stride.Cli/CrashCommand.cs:114

                if (Directory.Exists(path))
                    return ShowRun(CrashStore.OpenRun(path));
                if (File.Exists(path))
                    return ShowFile(path);

                Console.Error.WriteLine($"No crash report at '{path}'.");
                return 1;
            }
            catch (Exception exception)
            {
                Console.Error.WriteLine($"Failed to read: {exception.Message}");
                return 1;
            }
        });

        // test: deliberately throw, so the whole crash pipeline (store, consent prompt, send) can be
        // exercised end to end without a real bug.
        var testCommand = new Command("test", "Throw a test exception to exercise the crash-report pipeline.") { Hidden = true };
        testCommand.SetAction(int (ParseResult _) => throw new InvalidOperationException("Test crash from 'stride crash test'."));

        var crash = new Command("crash", "List, show and send crash reports saved by Stride's headless tools.");
        crash.Subcommands.Add(listCommand);
        crash.Subcommands.Add(showCommand);
        crash.Subcommands.Add(sendCommand);
        crash.Subcommands.Add(testCommand);
        return crash;
    }

    // A whole run: print every deduped group it holds.
    private static int ShowRun(CrashRun run)
    {
        var crashes = run.Read();
        if (crashes.Count == 0)
        {
            Console.Error.WriteLine($"No crashes in '{run.Directory}'.");
            return 1;
        }

View on GitHub (pinned to 96fad776d2)