{"record":{"id":"2ff4869c4835395a","repo":"dotnet/runtime","slug":"coreclr-args-mode-2ff486","errorCode":null,"errorMessage":"{coreclr_args.mode}","messagePattern":"\\{coreclr_args\\.mode\\}","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":6126,"sourceCode":"        elapsed_time = end_time - begin_time\n\n        logging.debug(\"Finish time: %s\", end_time.strftime(\"%H:%M:%S\"))\n        logging.debug(\"Elapsed time: %s\", elapsed_time)\n\n    elif coreclr_args.mode == \"list-collections\":\n        if coreclr_args.local:\n            list_collections_local_command(coreclr_args)\n        else:\n            list_collections_command(coreclr_args)\n\n    elif coreclr_args.mode == \"merge-mch\":\n        success = merge_mch(coreclr_args)\n\n    elif coreclr_args.mode == \"summarize\":\n        summarize_json_summaries(coreclr_args)\n\n    else:\n        raise NotImplementedError(coreclr_args.mode)\n\n    return 0 if success else 1\n\n################################################################################\n# __main__\n################################################################################\n\nif __name__ == \"__main__\":\n    args = parser.parse_args()\n    sys.exit(main(args))\n","sourceCodeStart":6108,"sourceCodeEnd":6137,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi.py#L6108-L6137","documentation":"Raised as a defensive fallback in superpmi.py's main() dispatch when coreclr_args.mode does not match any of the implemented modes (collect, replay, asmdiffs, tpdiff, metricdiff, upload, upload-private, download, list-collections, merge-mch, summarize). It signals that a mode value reached the dispatch chain at src/coreclr/scripts/superpmi.py:6126 without a matching elif handler.","triggerScenarios":"Passing an unrecognized or misspelled --mode/subcommand to superpmi.py, or invoking main() with a mode string that exists in the argument parser but has no corresponding elif branch in the run-dispatch block.","commonSituations":"Typos in the mode name (e.g. 'collcet'), using a mode name from a different/newer checkout than the one running, or programmatic calls that set coreclr_args.mode to an unhandled value.","solutions":["Run `python superpmi.py --help` to list valid subcommands and use the exact name.","Check for typos or stray whitespace in the mode argument.","Grep the checked-out superpmi.py for `coreclr_args.mode ==` to confirm the mode is implemented in this version.","If you are adding a new mode, add a matching elif branch in both dispatch blocks (setup near line 5333 and run near line 5918)."],"exampleFix":"// before\npython superpmi.py collcet -core_root ...\n// after\npython superpmi.py collect -core_root ...","handlingStrategy":"validation","validationCode":"valid_modes = {'collect', 'replay', 'asmdiffs', 'tpdiff', 'metricdiff',\n                  'upload', 'upload-private', 'download', 'list-collections',\n                  'merge-mch', 'summarize'}\nif coreclr_args.mode not in valid_modes:\n    parser.error(f\"Unknown mode '{coreclr_args.mode}'. Valid: {sorted(valid_modes)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use argparse subparsers with choices= to reject invalid modes at parse time.","When adding a mode to the parser, add the matching elif branch in the same commit."],"tags":["dotnet","coreclr","superpmi","cli-args","configuration"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}