[ 
https://issues.apache.org/jira/browse/TAP5-721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714694#action_12714694
 ] 

Joost Schouten commented on TAP5-721:
-------------------------------------

I just started looking for a way on how to make this work and have an 
architecture question. The logic to handle a missing key message or exception 
lives in AbstractMessages and is quite straight forward. Adding a boolean field 
exceptionOnMissingKey which defaults to false and providing an extra 
constructor taking both the Locale and this boolean. The tricky part however is 
that all Messages are instantiated using a static forClass() method which 
obviously cant pass any System property like this one along. In my oppinion 
this only leaves me with the option of making the exceptionOnMissingKey a 
static field and setting it in the TapestryModule, depending on 
SymbolConstant.EXCEPTION_ON_MISSING_KEY == "true".

I don't particularly like the idea of a static field though and can imagine 
more people with me. So my question; What would be the best way to go about 
this problem? Is there a singleton service we can always asume present for all 
of Tapestry which could be accessed by the AbstractMessages? Or would there 
need to be a complete rethink of how Messages are instantiated in order to 
cater for Exceptions on missing keys?

Cheers,
Joost

> missing message key fail with exception
> ---------------------------------------
>
>                 Key: TAP5-721
>                 URL: https://issues.apache.org/jira/browse/TAP5-721
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.2
>            Reporter: Joost Schouten
>
> I would like a way to tell tapestry to thrown an exception on encountering a 
> missing message key. Printing of the "missing key" message on the page 
> results in silent failure especially for larger apps.
> I would propose adding a boolean symbol along the lines of 
> MISSING_MESSAGE_KEY_FAIL_WITH_EXCEPTION which defaults to false.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to