Pull requests

#5 Open
Repository
dereckson dereckson
Branch
default
Repository
sjl sjl
Branch
default

Intercept common IO errors exceptions.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update 
hg pull -r default https://bitbucket.org/dereckson/t
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

Comments (0)