]> git.sur5r.net Git - i3/i3status/commitdiff
check_mail.py: more detailed report on IOError 100/head
authorDmitrij D. Czarkoff <czarkoff@gmail.com>
Thu, 21 Jan 2016 09:36:30 +0000 (10:36 +0100)
committerDmitrij D. Czarkoff <czarkoff@gmail.com>
Thu, 21 Jan 2016 09:36:30 +0000 (10:36 +0100)
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".

contrib/check_mail.py

index 14d2e82279b585c461d9932e652cd91302ba1ae6..ac23f77eee6024c5a7a60edf4853308cfa438833 100755 (executable)
@@ -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