Skip to content

Commit de30a4b

Browse files
committedNov 22, 2015
master/worker: print short exception info in first log entry of worker error
1 parent 8b4b269 commit de30a4b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

Diff for: ‎artiq/master/worker_impl.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,13 @@ def main():
221221
put_object({"action": "completed"})
222222
elif action == "terminate":
223223
break
224-
except:
225-
logging.error("Worker terminating with exception", exc_info=True)
224+
except Exception as exc:
225+
short_exc_info = type(exc).__name__
226+
exc_str = str(exc)
227+
if exc_str:
228+
short_exc_info += ": " + exc_str
229+
logging.error("Terminating with exception (%s)",
230+
short_exc_info, exc_info=True)
226231
finally:
227232
device_mgr.close_devices()
228233

0 commit comments

Comments
 (0)
Please sign in to comment.