I want this output:
RuntimeError: Unable to parse Powershell-encoded commands.
was a `{$...}` left in the command?
Process finished with exit code 1
I would like to use code like this:
if sys.argv[1] == '-encodedCommand':
raise RuntimeError("Unable to parse Powershell-encoded commands.").with_note('was a `{$...}` left in the command?')
This code does what I want, but it looks ugly:
if sys.argv[1] == '-encodedCommand':
to_raise = RuntimeError(f"Unable to parse Powershell-encoded commands.")
to_raise.add_note('was a `{$...}` left in the command?')
raise to_raise
Does anyone have a suggestion?
New contributor
2