~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Martin Pool
  • Date: 2011-03-29 08:29:03 UTC
  • mto: (5425.4.19 220464-stale-locks)
  • mto: This revision was merged to the branch mainline in revision 5970.
  • Revision ID: mbp@canonical.com-20110329082903-66vhw6a7lm0qd9pa
Clearer messages for unprintable user warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
310
310
        try:
311
311
            template = self._user_warning_templates[warning_id]
312
312
        except KeyError:
313
 
            fail = "failed to format warning %r, %r" % (warning_id, message_args)
314
 
            warnings.warn(fail)   # so tests will fail etc
 
313
            fail = "bzr warning: %r, %r" % (warning_id, message_args)
 
314
            warnings.warn("no template for warning: " + fail)   # so tests will fail etc
315
315
            return fail
316
316
        try:
317
317
            return template % message_args
318
318
        except ValueError, e:
319
 
            fail = "failed to format warning %r, %r: %s" % (
 
319
            fail = "bzr unprintable warning: %r, %r, %s" % (
320
320
                warning_id, message_args, e)
321
321
            warnings.warn(fail)   # so tests will fail etc
322
322
            return fail