Bug 1286075: dump data that fails validation; r=wcosta draft
authorDustin J. Mitchell <dustin@mozilla.com>
Wed, 31 Aug 2016 20:10:19 +0000
changeset 412737 61c44d02841dc497f4f9ade2a912c02e86ead62f
parent 412736 0913aa8cdf153cd086a7786de957535e9b3a4ee8
child 412738 003971b8caf20565f03a800ae5712fe775366e92
push id29252
push userdmitchell@mozilla.com
push dateMon, 12 Sep 2016 19:16:39 +0000
reviewerswcosta
bugs1286075
milestone51.0a1
Bug 1286075: dump data that fails validation; r=wcosta This was Wander's idea, in fact! MozReview-Commit-ID: fGBjfYwPv8
taskcluster/taskgraph/transforms/base.py
--- a/taskcluster/taskgraph/transforms/base.py
+++ b/taskcluster/taskgraph/transforms/base.py
@@ -1,15 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import re
+import pprint
 import voluptuous
 
 
 class TransformConfig(object):
     """A container for configuration affecting transforms.  The `config`
     argument to transforms is an instance of this class, possibly with
     additional kind-specific attributes beyond those set here."""
     def __init__(self, kind, path, config, params):
@@ -64,17 +65,17 @@ def validate_schema(schema, obj, msg_pre
     beginning with msg_prefix.
     """
     try:
         return schema(obj)
     except voluptuous.MultipleInvalid as exc:
         msg = [msg_prefix]
         for error in exc.errors:
             msg.append(str(error))
-        raise Exception('\n'.join(msg))
+        raise Exception('\n'.join(msg) + '\n' + pprint.pformat(obj))
 
 
 def get_keyed_by(item, field, item_name, subfield=None):
     """
     For values which can either accept a literal value, or be keyed by some
     other attribute of the item, perform that lookup.  For example, this supports
 
         chunks: