check_mail.py: more detailed report on IOError

When user doesn't have permissions to access some file, he is better served by
exact error message python recieved then by statement "not a mailbox".
This commit is contained in:
Dmitrij D. Czarkoff 2016-01-21 10:36:30 +01:00
parent b0cfdeab77
commit cc77338ff4
1 changed files with 3 additions and 0 deletions

View File

@ -82,6 +82,9 @@ def check_mail(label, nomail, ignore, colors):
else:
return nomail, colors[0]
except IOError, exception:
return '{0}: {1}'.format(name, exception.strerror), colors[2]
except:
pass