Ugly stacktrace when the target directory for the cast doesn't exist
PawelLipski opened this issue · comments
$ asciinema rec foo/bar/qux
asciinema: recording asciicast to foo/bar/qux
asciinema: press <ctrl-d> or type "exit" when you're done
bash-5.2$ Process Process-2:
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/recorder.py", line 141, in run
with self.writer as w:
File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/asciicast/v2.py", line 126, in __enter__
self._open_file()
File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/asciicast/v2.py", line 156, in _open_file
self.file = open(
^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'foo/bar/qux'
Traceback (most recent call last):
File "/usr/local/bin/asciinema", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/__main__.py", line 215, in main
code = command.execute()
^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/commands/record.py", line 106, in execute
recorder.record(
File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/recorder.py", line 61, in record
with async_writer(sync_writer, time_offset, record_stdin) as _writer:
File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/async_worker.py", line 35, in __exit__
raise RuntimeError(
RuntimeError: worker process exited with code 1
Yeah, those are ugly indeed :)