Commit 826651af authored by Yuzhu Shen's avatar Yuzhu Shen Committed by Commit Bot

Make the generator output easier-to-understand error message for undefined types.

BUG=788704

Change-Id: Iedd0fb694e88db9a492f9b670f1e1fd177120a10
Reviewed-on: https://chromium-review.googlesource.com/802402Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520822}
parent 047e4582
......@@ -56,7 +56,8 @@ class PackedField(object):
# TODO(mpcomplete): what about big enums?
return cls.kind_to_size[mojom.INT32]
if not kind in cls.kind_to_size:
raise Exception("Invalid kind: %s" % kind.spec)
raise Exception("Undefined type: %s. Did you forget to import the file "
"containing the definition?" % kind.spec)
return cls.kind_to_size[kind]
@classmethod
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment