1. Steve Losh
  2. t
  3. Pull requests

Pull requests

#5 Merged
Repository
dereckson
Branch
default
Repository
sjl
Branch
default

Intercept common IO errors exceptions.

Author
  1. Sébastien Santoro
Reviewers
Description

This full request fixes issue #2.

When the task directory doesn't exist or when a file can't be read or written, t.py fails with a full stacktrace exception. This change allows t.py to fail more gracefully, printing the exception message, the relevant file, and then exiting with an errorlevel code of 1.

# Non existant directory issue
/home/dereckson/dev/t ] ./t.py -t /nonexistent Lorem ipsum dolor
No such file or directory - /nonexistent/tasks

# File permission issue
/home/dereckson/dev/t ] mkdir test
/home/dereckson/dev/t ] ./t.py -t test Lorem ipsum dolor
/home/dereckson/dev/t ] chmod 000 test/.tasks.done
/home/dereckson/dev/t ] ./t.py -t test Lorem ipsum dolor
Permission denied - test/.tasks.done
  • Issues #2: Crash if task-dir does not exists resolved

Comments (1)