File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,20 @@ def close(self):
100
100
101
101
orig_work_dir = None
102
102
if self .work_dir :
103
- orig_work_dir = os .getcwd ()
103
+ try :
104
+ orig_work_dir = os .getcwd ()
105
+ except OSError as e :
106
+ self .state = Command .ERRORED
107
+ self .logger .error ("Cannot get working directory" ,
108
+ exc_info = True )
109
+ return
110
+
104
111
try :
105
112
os .chdir (self .work_dir )
106
113
except OSError as e :
107
114
self .state = Command .ERRORED
108
115
self .logger .error ("Cannot change working directory to {}" .
109
- format (self .work_dir ))
116
+ format (self .work_dir ), exc_info = True )
110
117
return
111
118
112
119
othr = OutputThread ()
@@ -123,11 +130,11 @@ def close(self):
123
130
stdout = othr )
124
131
p .wait ()
125
132
except KeyboardInterrupt as e :
126
- self .logger .debug ("Got KeyboardException while processing " ,
127
- exc_info = True )
133
+ self .logger .info ("Got KeyboardException while processing " ,
134
+ exc_info = True )
128
135
self .state = Command .INTERRUPTED
129
136
except OSError as e :
130
- self .logger .debug ("Got OS error" , exc_info = True )
137
+ self .logger .error ("Got OS error" , exc_info = True )
131
138
self .state = Command .ERRORED
132
139
else :
133
140
self .state = Command .FINISHED
You can’t perform that action at this time.
0 commit comments