Skip to content

Commit 0a9a499

Browse files
Improved logging for IDE errors in tests
1 parent 2792cf9 commit 0a9a499

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sagemaker_ssh_helper/proxy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,17 @@ def run_command_with_output(self, command):
123123
except subprocess.CalledProcessError as e:
124124
out = e.output.decode('latin1')
125125
proxy_out = self.fetch_proxy_output()
126-
raise ValueError(
126+
error = ValueError(
127127
f"Failed to run command: {command}. "
128128
f"Return code: {e.returncode}. "
129129
f"\n---Begin proxy output:---\n{proxy_out}---End proxy output--- "
130130
f"\n---Begin output:---\n{out}---End output---. "
131131
f"Check your local log, stdout, and stderr "
132132
f"as well as remote logs{' at ' + self.cloudwatch_url if self.cloudwatch_url else ''} "
133133
f"for more details, if needed."
134-
) from e
134+
)
135+
self.logger.error(f"Failed to run command: {e}", exc_info=error)
136+
raise error from e
135137

136138
def fetch_proxy_output(self):
137139
array_of_byte_strings = []

0 commit comments

Comments
 (0)