Index: tools/json_schema_compiler/code.py |
diff --git a/tools/json_schema_compiler/code.py b/tools/json_schema_compiler/code.py |
index 4f2a64b014c8ad56a7da64d7a6d1919027986eb2..c19029a1ef0a2b3ba5135cbfc57dd9b12b0d08cb 100644 |
--- a/tools/json_schema_compiler/code.py |
+++ b/tools/json_schema_compiler/code.py |
@@ -35,11 +35,14 @@ class Code(object): |
isolate any strings that haven't been substituted. |
""" |
if not isinstance(obj, Code): |
- raise TypeError() |
+ raise TypeError(type(obj)) |
assert self is not obj |
for line in obj._code: |
- # line % () will fail if any substitution tokens are left in line |
- self._code.append(((' ' * self._indent_level) + line % ()).rstrip()) |
+ try: |
+ # line % () will fail if any substitution tokens are left in line |
+ self._code.append(((' ' * self._indent_level) + line % ()).rstrip()) |
+ except TypeError: |
+ raise TypeError('Unsubstituted value when concatting\n' + line) |
return self |