Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 70695 invoked from network); 9 Jul 2010 18:22:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jul 2010 18:22:46 -0000 Received: (qmail 35498 invoked by uid 500); 9 Jul 2010 18:22:46 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 35367 invoked by uid 500); 9 Jul 2010 18:22:45 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 35359 invoked by uid 99); 9 Jul 2010 18:22:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 18:22:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 18:22:42 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o69IEoWY006710 for ; Fri, 9 Jul 2010 18:14:50 GMT Message-ID: <25969923.289041278699290615.JavaMail.jira@thor> Date: Fri, 9 Jul 2010 14:14:50 -0400 (EDT) From: "Ole Ersoy (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (MATH-361) Localization and Error Handling In-Reply-To: <588355934.629481270116987224.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886808#action_12886808 ] Ole Ersoy commented on MATH-361: -------------------------------- The one enum per class idea is meant to enable detailed context messages for end users. I'm suggesting that this enum only be used to communicate messages for end users. I, and I think you as well, think that the core CM library classes should not use this enum at all. The core CM library should only use the minimal set of Enums that are very generic. Then if the maintainer of a specific class wants to provide additional messages that capture the context of a problem to a greater extent, they should go in a separate Enum class that matches the class that would have generated the exception with the generic enum. Note that with this approach, an exception does not necessarily have to be generated in order for an application developer to make use of the Enum messages accompanying a class. For instance there may be a "Alpha parameter field" where the user enters a number. If the number is negative, the application pulls a Commons Math provided message that says that the "Alpha parameter of the Gamma Distribution must always positive". So the goal of having an Enum per class, is to have all messages that could be helpful to an end user ready to go. The javadoc could then go into further detail with respect what would trigger the need to show these messages to the end user. So for instance the javadoc could say that "if a negative alpha parameter is submitted it will trigger a PositiveNumbersOnlyException (With the generic "Only positive numbers allowed" message ). If you are an application developer, avoid this exception being triggered by first validating that the number is negative, and if it is, show the following message from the GammaDistributionEnum class to your user.... > Localization and Error Handling > ------------------------------- > > Key: MATH-361 > URL: https://issues.apache.org/jira/browse/MATH-361 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 2.1 > Reporter: Gilles > Priority: Minor > Attachments: l10n.tar.gz, res.tar.gz > > > This proposal aims at easing the handling of error during algorithms development, and also enhancing the flexibility of the error reporting (provide meaningful exception classes and run-time selection of the localization formatting). > More details at [http://www.mail-archive.com/dev@commons.apache.org/msg14570.html] -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.