[jira] [Commented] (TAP5-2550) Optionally throw an exception on message catalog lookup failures
[ https://issues.apache.org/jira/browse/TAP5-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16352082#comment-16352082 ] Benjamin Weidig commented on TAP5-2550: --- Sounds reasonable. I no longer have a Tapestry5 source dev setup and much free time currently, so it might take a little to prepare a new patch. > Optionally throw an exception on message catalog lookup failures > > > Key: TAP5-2550 > URL: https://issues.apache.org/jira/browse/TAP5-2550 > Project: Tapestry 5 > Issue Type: Wish >Affects Versions: 5.4.1 >Reporter: I D >Priority: Major > Attachments: 0001-TAP5-2550-Added-new-missing-messages-handling.patch > > > Currently, whenever a message catalog lookup fails, tapestry returns the > placeholder String {{[[missing key: key-not-found]]}}. This behavior is > implemented in {{AbstractMessages.get()}}. > In a way, this is a silent failure, and the one who sees this string is more > likely the app's end user than the tapestry user. > It would be great if there would be a global configuration property (e.g. > {{SymbolConstants.EXCEPTION_ON_MISSING_MESSAGE}}, defaulting to {{false}}) > allowing us to instruct tapestry to throw an exception instead (perhaps a > {{NoSuchElementException}}). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (TAP5-2550) Optionally throw an exception on message catalog lookup failures
[ https://issues.apache.org/jira/browse/TAP5-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16351894#comment-16351894 ] Bob Harner commented on TAP5-2550: -- To simplify things a bit, I think there should only be two behaviors: # show the placeholder string and log a warning about the missing key (the default) # throw an exception So this would only require a boolean symbol, which I think should be called "tapestry.strict-message-handling" (SymbolConstants.STRICT_MESSAGE_HANDLING), following the naming convention of the existing SymbolConstants.STRICT_CSS_URL_REWRITING symbol. > Optionally throw an exception on message catalog lookup failures > > > Key: TAP5-2550 > URL: https://issues.apache.org/jira/browse/TAP5-2550 > Project: Tapestry 5 > Issue Type: Wish >Affects Versions: 5.4.1 >Reporter: I D >Priority: Major > Attachments: 0001-TAP5-2550-Added-new-missing-messages-handling.patch > > > Currently, whenever a message catalog lookup fails, tapestry returns the > placeholder String {{[[missing key: key-not-found]]}}. This behavior is > implemented in {{AbstractMessages.get()}}. > In a way, this is a silent failure, and the one who sees this string is more > likely the app's end user than the tapestry user. > It would be great if there would be a global configuration property (e.g. > {{SymbolConstants.EXCEPTION_ON_MISSING_MESSAGE}}, defaulting to {{false}}) > allowing us to instruct tapestry to throw an exception instead (perhaps a > {{NoSuchElementException}}). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (TAP5-2550) Optionally throw an exception on message catalog lookup failures
[ https://issues.apache.org/jira/browse/TAP5-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15791142#comment-15791142 ] Benjamin Weidig commented on TAP5-2550: --- Because I'm sometimes fail to see missing message keys I tried to implement this feature request. AbstractMessages is implemented in commons, so we can't access SymbolConstants (AFAIK), that's why I only implemented this feature for MapMessages. SymbolConstants.MISSING_MESSAGES_HANDLING can be the following values: - "placeholder": The default value, the behaviour is like the one before the patch - "warn": A warning about the missing key will be logged - "fail": MapMessages will throw a RuntimeException - An empty string will fallback to placeholder What do you think? > Optionally throw an exception on message catalog lookup failures > > > Key: TAP5-2550 > URL: https://issues.apache.org/jira/browse/TAP5-2550 > Project: Tapestry 5 > Issue Type: Wish >Affects Versions: 5.4.1 >Reporter: I D > > Currently, whenever a message catalog lookup fails, tapestry returns the > placeholder String {{[[missing key: key-not-found]]}}. This behavior is > implemented in {{AbstractMessages.get()}}. > In a way, this is a silent failure, and the one who sees this string is more > likely the app's end user than the tapestry user. > It would be great if there would be a global configuration property (e.g. > {{SymbolConstants.EXCEPTION_ON_MISSING_MESSAGE}}, defaulting to {{false}}) > allowing us to instruct tapestry to throw an exception instead (perhaps a > {{NoSuchElementException}}). -- This message was sent by Atlassian JIRA (v6.3.4#6332)