From bee7a793dee719a5edac218149ddccfda9d07eb3 Mon Sep 17 00:00:00 2001 From: "DHNishi@gmail.com" Date: Mon, 12 Aug 2013 23:45:38 +0000 Subject: Add optional schema compiler error messages and unit tests. Provides the ability to generate error messages within schema-compiled code for ease of debugging. Error messages may be disabled by adding a 'generate_error_messages' property to json schema, e.g. "generate_error_messages": false Error generation mostly written by Aaron Jacobs (https://codereview.chromium.org/16462004/). BUG=234834 Review URL: https://chromiumcodereview.appspot.com/22228002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217118 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/json_schema_compiler/code.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/json_schema_compiler/code.py') diff --git a/tools/json_schema_compiler/code.py b/tools/json_schema_compiler/code.py index a0a2a5fa..3622237 100644 --- a/tools/json_schema_compiler/code.py +++ b/tools/json_schema_compiler/code.py @@ -49,9 +49,9 @@ class Code(object): if line.substitute: line.value %= () except TypeError: - raise TypeError('Unsubstituted value when concatting\n' + line) + raise TypeError('Unsubstituted value when concatting\n' + line.value) except ValueError: - raise ValueError('Stray % character when concatting\n' + line) + raise ValueError('Stray % character when concatting\n' + line.value) self.Append(line.value, line.substitute) return self -- cgit v1.1