diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 19:15:51 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 19:15:51 +0000 |
commit | 9ee87dab497d4f2139509f2d68b170ee8d4444b5 (patch) | |
tree | 7b1368bf4130e5c15825ddbd240b0c63088c32b1 /tools | |
parent | dab37783392a25206ce529464723304d955fa637 (diff) | |
download | chromium_src-9ee87dab497d4f2139509f2d68b170ee8d4444b5.zip chromium_src-9ee87dab497d4f2139509f2d68b170ee8d4444b5.tar.gz chromium_src-9ee87dab497d4f2139509f2d68b170ee8d4444b5.tar.bz2 |
Provide better error messages when grit fails to open a file while
flattening.
BUG=70185
Review URL: http://codereview.chromium.org/6401001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72853 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/grit/grit/format/html_inline.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/grit/grit/format/html_inline.py b/tools/grit/grit/format/html_inline.py index c5cb074..b8b9c01 100755 --- a/tools/grit/grit/format/html_inline.py +++ b/tools/grit/grit/format/html_inline.py @@ -222,7 +222,11 @@ def InlineToString(input_filename, grd_node): Returns: the inlined data as a string """ - return DoInline(input_filename, grd_node).inlined_data + try: + return DoInline(input_filename, grd_node).inlined_data + except IOError, e: + raise Exception("Failed to open %s while trying to flatten %s. (%s)" % + (e.filename, input_filename, e.strerror)) def InlineToFile(input_filename, output_filename, grd_node): @@ -247,7 +251,11 @@ def InlineToFile(input_filename, output_filename, grd_node): def GetResourceFilenames(filename): """For a grd file, returns a set of all the files that would be inline.""" - return DoInline(filename, None).inlined_files + try: + return DoInline(filename, None).inlined_files + except IOError, e: + raise Exception("Failed to open %s while trying to flatten %s. (%s)" % + (e.filename, filename, e.strerror)) def main(): |