Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 91987 invoked from network); 18 Apr 2009 20:42:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Apr 2009 20:42:44 -0000 Received: (qmail 43729 invoked by uid 500); 18 Apr 2009 20:42:43 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 43646 invoked by uid 500); 18 Apr 2009 20:42:43 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 43637 invoked by uid 99); 18 Apr 2009 20:42:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Apr 2009 20:42:43 +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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Apr 2009 20:42:41 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CE8FF2388A1B; Sat, 18 Apr 2009 20:42:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r766388 - in /couchdb/branches/0.9.x: ./ etc/default/couchdb share/server/main.js src/couchdb/couch_js.c src/couchdb/couch_os_process.erl Date: Sat, 18 Apr 2009 20:42:19 -0000 To: commits@couchdb.apache.org From: jchris@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090418204219.CE8FF2388A1B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jchris Date: Sat Apr 18 20:42:19 2009 New Revision: 766388 URL: http://svn.apache.org/viewvc?rev=766388&view=rev Log: merge 765479 (better JS error handling) into 0.9.x branch Modified: couchdb/branches/0.9.x/ (props changed) couchdb/branches/0.9.x/etc/default/couchdb (props changed) couchdb/branches/0.9.x/share/server/main.js couchdb/branches/0.9.x/src/couchdb/couch_js.c couchdb/branches/0.9.x/src/couchdb/couch_os_process.erl Propchange: couchdb/branches/0.9.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Apr 18 20:42:19 2009 @@ -1,3 +1,3 @@ /couchdb/branches/design_resources:751716-751803 /couchdb/branches/form:729440-730015 -/couchdb/trunk:758717,760442,760503,760532,760535,760537-760539,761343,761347-761348,761352-761353,761355,762016,765420,766347,766353,766358,766373 +/couchdb/trunk:758717,760442,760503,760532,760535,760537-760539,761343,761347-761348,761352-761353,761355,762016,765420,765479,766347,766353,766358,766373 Propchange: couchdb/branches/0.9.x/etc/default/couchdb ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Apr 18 20:42:19 2009 @@ -1,4 +1,4 @@ /couchdb/branches/design_resources/etc/default/couchdb:751716-751803 /couchdb/branches/form/etc/default/couchdb:729440-730015 -/couchdb/trunk/etc/default/couchdb:758717,760442,760503,760532,760535,760537-760539,761343,761347-761348,761352-761353,761355,762016,765420,766347,766353,766358,766373 +/couchdb/trunk/etc/default/couchdb:758717,760442,760503,760532,760535,760537-760539,761343,761347-761348,761352-761353,761355,762016,765420,765479,766347,766353,766358,766373 /incubator/couchdb/trunk/etc/default/couchdb:642419-694440 Modified: couchdb/branches/0.9.x/share/server/main.js URL: http://svn.apache.org/viewvc/couchdb/branches/0.9.x/share/server/main.js?rev=766388&r1=766387&r2=766388&view=diff ============================================================================== --- couchdb/branches/0.9.x/share/server/main.js [utf-8] (original) +++ couchdb/branches/0.9.x/share/server/main.js [utf-8] Sat Apr 18 20:42:19 2009 @@ -414,7 +414,8 @@ } catch(e) { log("function raised error: "+e.toString()); log("stacktrace: "+e.stack); - respond({error:"render_error",reason:e}); + var errorMessage = "function raised error: "+e.toString()+"\nstacktrace: "+e.stack; + respond({error:"render_error",reason:errorMessage}); } }; Modified: couchdb/branches/0.9.x/src/couchdb/couch_js.c URL: http://svn.apache.org/viewvc/couchdb/branches/0.9.x/src/couchdb/couch_js.c?rev=766388&r1=766387&r2=766388&view=diff ============================================================================== --- couchdb/branches/0.9.x/src/couchdb/couch_js.c (original) +++ couchdb/branches/0.9.x/src/couchdb/couch_js.c Sat Apr 18 20:42:19 2009 @@ -231,6 +231,7 @@ } else { ok = JS_EvaluateUCScript(sub_context, sandbox, src, srclen, NULL, -1, rval); + ok = JS_TRUE; } out: Modified: couchdb/branches/0.9.x/src/couchdb/couch_os_process.erl URL: http://svn.apache.org/viewvc/couchdb/branches/0.9.x/src/couchdb/couch_os_process.erl?rev=766388&r1=766387&r2=766388&view=diff ============================================================================== --- couchdb/branches/0.9.x/src/couchdb/couch_os_process.erl (original) +++ couchdb/branches/0.9.x/src/couchdb/couch_os_process.erl Sat Apr 18 20:42:19 2009 @@ -51,7 +51,13 @@ gen_server:call(Pid, read). prompt(Pid, Data) -> - gen_server:call(Pid, {prompt, Data}, infinity). + case gen_server:call(Pid, {prompt, Data}, infinity) of + {ok, Result} -> + Result; + {error, Error} -> + ?LOG_DEBUG("OS Process Error ~p",[Error]), + throw(Error) + end. async(Pid, Data, CallBack) -> gen_server:cast(Pid, {async, Data, CallBack}). @@ -138,7 +144,13 @@ handle_call({prompt, Data}, _From, OsProc) -> #os_proc{writer=Writer, reader=Reader} = OsProc, Writer(OsProc, Data), - {reply, Reader(OsProc), OsProc}. + Result = try Reader(OsProc) of + Ok -> {ok, Ok} + catch + throw:OsError -> + {error, OsError} + end, + {reply, Result, OsProc}. handle_cast({async, Data, CallBack}, OsProc) -> #os_proc{writer=Writer, reader=Reader} = OsProc,