Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5B46F114C2 for ; Wed, 9 Jul 2014 07:36:05 +0000 (UTC) Received: (qmail 34510 invoked by uid 500); 9 Jul 2014 07:36:05 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 34454 invoked by uid 500); 9 Jul 2014 07:36:05 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 34432 invoked by uid 99); 9 Jul 2014 07:36:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2014 07:36:04 +0000 Date: Wed, 9 Jul 2014 07:36:04 +0000 (UTC) From: "Krashan Brahmanjara (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MYFACES-3902) jsf.js: error handling output improvement MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MYFACES-3902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14055959#comment-14055959 ] Krashan Brahmanjara commented on MYFACES-3902: ---------------------------------------------- We test software in Development mode and this alert never occurs - only log to console occurs. So we move " if(jsf.getProjectStage() === "Development") {" test before console test and now alert is visible in Development mode. This is more useful for developers. > jsf.js: error handling output improvement > ----------------------------------------- > > Key: MYFACES-3902 > URL: https://issues.apache.org/jira/browse/MYFACES-3902 > Project: MyFaces Core > Issue Type: Bug > Components: General > Affects Versions: 2.2.3 > Environment: Snapshot code 2.2.3 from trunk + Icefaces 4/Primefaces 4 > Firefox >=18 > Reporter: Krashan Brahmanjara > Fix For: 2.0.22, 2.1.16, 2.2.4 > > > Myfaces core do not show real javascipt errors. > In _Dom.js there is a catch block in rows 192-203. > Unofortunately I see two errors > - Icefaces js has exceptions without message and description a message is directly a 'e' object. So an error 'invalid property' is printed to console > - development mode is ignored by this catch block, in reverse order checking too because jsf.ajax.getProjectStage() is not initialized > Workaround - because development mode is recognized we can only show an alert > {noformat} > } catch (e) { > /* > if(window.console && window.console.error) { > //not sure if we > //should use our standard > //error mechanisms here > //because in the head appendix > //method only a console > //error would be raised as well > if (e.message) { > window.console.error(e.message); > } else { > if (e.description) { > window.console.error(e.description); > } else { > window.console.error(e); > } > } > } > if(jsf.ajax.getProjectStage() === "Development") { > */ > if (e.message) { > alert("Error in evaluated javascript:"+ (e.message)); > } else { > if (e.description) { > alert("Error in evaluated javascript:"+ (e.description)); > } else { > alert("Error in evaluated javascript:"+ (e)); > } > } > /* > } > */ > } finally { > {noformat} -- This message was sent by Atlassian JIRA (v6.2#6252)