Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nested exceptions in get_powershell_command #2058

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions autogen/code_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,15 @@ def get_powershell_command():
raise FileNotFoundError(
"Neither powershell.exe nor pwsh.exe is present in the system. "
"Please install PowerShell and try again. "
f"Original error: {e}"
)
) from e
except NotADirectoryError as e:
raise NotADirectoryError(
"PowerShell is either not installed or its path is not given "
"properly in the environment variable PATH. Please check the "
"path and try again. "
f"Original error: {e}"
)
) from e
except PermissionError as e:
raise PermissionError(f"No permission to run powershell. Original error: {e}")
raise PermissionError("No permission to run powershell.") from e


def _cmd(lang):
Expand Down
Loading