[javascriptlint-commit] SF.net SVN: javascriptlint:[332] trunk/javascriptlint
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2013-10-03 19:48:28
|
Revision: 332
http://sourceforge.net/p/javascriptlint/code/332
Author: matthiasmiller
Date: 2013-10-03 19:48:25 +0000 (Thu, 03 Oct 2013)
Log Message:
-----------
Gracefully handle IO errors.
Modified Paths:
--------------
trunk/javascriptlint/lint.py
trunk/javascriptlint/warnings.py
Modified: trunk/javascriptlint/lint.py
===================================================================
--- trunk/javascriptlint/lint.py 2013-10-03 19:39:07 UTC (rev 331)
+++ trunk/javascriptlint/lint.py 2013-10-03 19:48:25 UTC (rev 332)
@@ -302,8 +302,13 @@
return lint_cache[normpath]
if printpaths:
print normpath
- contents = fs.readfile(path, encoding)
+
lint_cache[normpath] = _Script()
+ try:
+ contents = fs.readfile(path, encoding)
+ except IOError, error:
+ _lint_error(0, 0, 'io_error', unicode(error))
+ return lint_cache[normpath]
script_parts = []
if kind == 'js':
Modified: trunk/javascriptlint/warnings.py
===================================================================
--- trunk/javascriptlint/warnings.py 2013-10-03 19:39:07 UTC (rev 331)
+++ trunk/javascriptlint/warnings.py 2013-10-03 19:48:25 UTC (rev 332)
@@ -114,6 +114,7 @@
'expected_tok': 'expected token: {token}',
'unexpected_char': 'unexpected character: {char}',
'unexpected_eof': 'unexpected end of file',
+ 'io_error': '{error}',
}
def format_error(errname, **errargs):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|