#11427 closed enhancement (fixed)
Improve error message in exceptions raised by ExtensionOption and OrderedExtensionOption
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | config exception |
Cc: | Branch: | ||
Release Notes: |
Improved hint in error messages from |
||
API Changes: | |||
Internal Changes: |
Description
It was discussed in th:#10980 that we might improve the error message in the exceptions raised from ExtensionOption
and OrderedExtensionOption
when the Component
is not active. For example:
ConfigurationError: Cannot find an implementation of the "IEmailSender" interface named "SmtpEmailSender". Please update the option announcer.email_sender in trac.ini.
→
ConfigurationError: Cannot find an implementation of the IEmailSender
interface named SmtpEmailSender
. Please check that the Component is enabled or update the option [announcer] email_sender
in trac.ini.
Attachments (2)
Change History (14)
comment:1 by , 11 years ago
Milestone: | 1.0.3 → 1.0.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
by , 11 years ago
Attachment: | t11427.patch added |
---|
follow-up: 12 comment:3 by , 11 years ago
I just noticed that the following are auto-linked:
ExtensionOption:
→ ExtensionOption:
**ExtensionOption**
→ ExtensionOption
but this one is not:
**ExtensionOption:**
→ ExtensionOption:
comment:4 by , 11 years ago
On second thought, the strings differ only by "… an implementation of …" / "… implementation(s) of …", so I will just make those the same and we will have one fewer string to translate.
comment:5 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
I've modified the patch to add an entry for each implementation that is not found:
Configuration Error
TracGuide — The Trac User and Administration Guide
The resulting diff of the pot file is:
-
trac/locale/messages.pot
diff --git a/trac/locale/messages.pot b/trac/locale/messages.pot index cc09b90..05a70ca 100644
a b msgstr "" 454 454 msgid "File '%(name)s' exists" 455 455 msgstr "" 456 456 457 #: trac/config.py:4 4457 #: trac/config.py:45 458 458 msgid "Configuration Error" 459 459 msgstr "" 460 460 461 #: trac/config.py:4 8461 #: trac/config.py:49 462 462 msgid "Look in the Trac log for more information." 463 463 msgstr "" 464 464 465 #: trac/config.py:27 3465 #: trac/config.py:274 466 466 #, python-format 467 467 msgid "Error reading '%(file)s', make sure it is readable." 468 468 msgstr "" 469 469 470 #: trac/config.py:43 0470 #: trac/config.py:431 471 471 #, python-format 472 472 msgid "[%(section)s] %(entry)s: expected integer, got %(value)s" 473 473 msgstr "" 474 474 475 #: trac/config.py:44 8475 #: trac/config.py:449 476 476 #, python-format 477 477 msgid "[%(section)s] %(entry)s: expected float, got %(value)s" 478 478 msgstr "" 479 479 480 #: trac/config.py:62 1480 #: trac/config.py:622 481 481 msgid "Setting attribute is not allowed." 482 482 msgstr "" 483 483 484 #: trac/config.py:70 1484 #: trac/config.py:702 485 485 #, python-format 486 486 msgid "[%(section)s] %(entry)s: expected one of (%(choices)s), got %(value)s" 487 487 msgstr "" 488 488 489 #: trac/config.py:7 34489 #: trac/config.py:741 trac/config.py:778 490 490 #, python-format 491 491 msgid "" 492 "Cannot find an implementation of the \"%(interface)s\"interface named "493 " \"%(implementation)s\". Please update the option %(section)s.%(name)s in"494 " trac.ini."492 "Cannot find an implementation of the %(interface)s interface named " 493 "%(implementation)s. Please check that the Component is enabled or update " 494 "the option %(option)s in trac.ini." 495 495 msgstr "" 496 496 497 #: trac/config.py:772 498 #, python-format 499 msgid "" 500 "Cannot find implementation(s) of the \"%(interface)s\" interface named " 501 "\"%(implementation)s\". Please update the option %(section)s.%(name)s in" 502 " trac.ini." 503 msgstr "" 504 505 #: trac/config.py:813 trac/config.py:826 497 #: trac/config.py:822 trac/config.py:835 506 498 #, python-format 507 499 msgid "Option '%(option)s' doesn't exist in section '%(section)s'" 508 500 msgstr ""
by , 11 years ago
Attachment: | t11427.2.patch added |
---|
comment:6 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Didn't mean to close this yet. I'm still just posting changes for review.
comment:7 by , 11 years ago
Status: | reopened → assigned |
---|
follow-up: 9 comment:8 by , 11 years ago
Looks good. But I like to show multiple component names in a error message, not each message. See [a54790de/jomae.git].
Configuration Error
TracGuide — The Trac User and Administration Guide
follow-up: 10 comment:9 by , 11 years ago
Replying to jomae:
Looks good. But I like to show multiple component names in a error message, not each message.
Would you suggest using the same error message for ExtensionOption
as well, or having a slightly different message, as shown in comment:2? I tend to think it will be strange to use the same error message and suggest that implementation(s) could exist for an ExtensionOption
.
comment:10 by , 11 years ago
Replying to rjollos:
Would you suggest using the same error message for
ExtensionOption
as well, or having a slightly different message, as shown in comment:2?
The message for OrderedExtensionOption
in comment:2 is the same.
However, that generates a tt
element for each component name, not one tt
element.
<tt>AlphaPolicy, BetaPolicy, ThetaPolicy</tt>
→
<tt>AlphaPolicy</tt>, <tt>BetaPolicy</tt>, <tt>ThetaPolicy</tt>
I tend to think it will be strange to use the same error message and suggest that implementation(s) could exist for an
ExtensionOption
.
I understand your intention. But, if more than one missing components are in trac.ini, I confused and scared similar messages which are repeated, e.g. Cannot find … in trac.ini. Cannot find … in trac.ini. in comment:5.
comment:11 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:12 by , 8 years ago
Replying to Ryan J Ollos:
I just noticed that the following are auto-linked:
ExtensionOption:
→ ExtensionOption:
**ExtensionOption**
→ ExtensionOptionbut this one is not:
**ExtensionOption:**
→ ExtensionOption:
Reported in #12733.
Proposed change can be found in attachment:t11427.patch.
tt
tags will be replaced withcode
tags on merge to trunk (#11094). The result is:ExtensionOption:
Configuration Error
TracGuide — The Trac User and Administration Guide
OrderedExtensionOption:
Configuration Error
TracGuide — The Trac User and Administration Guide