From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4677 invoked by alias); 14 Nov 2007 21:26:06 -0000 Received: (qmail 4666 invoked by uid 22791); 14 Nov 2007 21:26:06 -0000 X-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 14 Nov 2007 21:26:03 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.1) with ESMTP id lAELQ1Gj028341 for ; Wed, 14 Nov 2007 16:26:01 -0500 Received: from pobox-3.corp.redhat.com (pobox-3.corp.redhat.com [10.11.255.67]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id lAELQ1DO012217 for ; Wed, 14 Nov 2007 16:26:01 -0500 Received: from toner.toronto.redhat.com (toner.yyz.redhat.com [10.15.16.55]) by pobox-3.corp.redhat.com (8.13.1/8.13.1) with ESMTP id lAELPx1l019035 for ; Wed, 14 Nov 2007 16:26:01 -0500 Message-ID: <473B67E7.3080902@redhat.com> Date: Wed, 14 Nov 2007 21:26:00 -0000 From: Sami Wagiaalla User-Agent: Thunderbird 2.0.0.5 (X11/20070727) MIME-Version: 1.0 To: frysk@sourceware.org Subject: Frysk exceptions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q4/txt/msg00131.txt.bz2 I have been meaning to write this for a while to clarify to my self the frysk strategy with respect to Exceptions and handling. These are my practices; please tell me if you agree or disagree: * All frysk exceptions are (should ?) be unchecked exceptions ie extend RunTimeException. * Exceptions should never ever be ignored. * Exceptions can be ignored (handled) if they are specific enough (eg operation XYZFailedException) * Except for certain cases catch statements should be as specific as possible. So no catch(Exception e) statements, but catch(SymboleNotFoundException e). * Exceptions are better than returning null. All other exceptions -which are not caught-, should be printed out in the most obvious way possible. This tells the use that there is a bug in frysk and that they should report it. The alternative (if it was logged, or cleaned up) is that the user assumes it is a non fatal error and continues to use frysk only to find it in a bad state much later. Resulting a difficult problem to debug.