266 def __init__(self, field, config, msg):
267 self.fieldType = type(field)
268 """Type of the `~lsst.pex.config.Field` that incurred the error.
269 """
270
271 self.fieldName = field.name
272 """Name of the `~lsst.pex.config.Field` instance that incurred the
273 error (`str`).
274
275 See also
276 --------
277 lsst.pex.config.Field.name
278 """
279
280 self.fullname = _joinNamePath(config._name, field.name)
281 """Fully-qualified name of the `~lsst.pex.config.Field` instance
282 (`str`).
283 """
284
285 self.history = config.history.setdefault(field.name, [])
286 """Full history of all changes to the `~lsst.pex.config.Field`
287 instance.
288 """
289
290 self.fieldSource = field.source
291 """File and line number of the `~lsst.pex.config.Field` definition.
292 """
293
294 self.configSource = config._source
295 error = (
296 "%s '%s' failed validation: %s\n"
297 "For more information see the Field definition at:\n%s"
298 " and the Config definition at:\n%s"
299 % (
300 self.fieldType.__name__,
301 self.fullname,
302 msg,
303 self.fieldSource.format(),
304 self.configSource.format(),
305 )
306 )
307 super().__init__(error)
308
309