Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 178CFDD84 for ; Thu, 27 Dec 2012 04:03:23 +0000 (UTC) Received: (qmail 87474 invoked by uid 500); 27 Dec 2012 04:03:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 87373 invoked by uid 500); 27 Dec 2012 04:03:20 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 87333 invoked by uid 99); 27 Dec 2012 04:03:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2012 04:03:18 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jens@couchbase.com designates 206.225.164.30 as permitted sender) Received: from [206.225.164.30] (HELO EXHUB020-3.exch020.serverdata.net) (206.225.164.30) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2012 04:03:10 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.73]) by EXHUB020-3.exch020.serverdata.net ([206.225.164.30]) with mapi; Wed, 26 Dec 2012 20:02:46 -0800 From: Jens Alfke To: "user@couchdb.apache.org" CC: Scott Date: Wed, 26 Dec 2012 20:02:45 -0800 Subject: Re: Documented API does not work. Thread-Topic: Documented API does not work. Thread-Index: Ac3j5wbFvxrE6n5TRO+w5DaGqF9YuA== Message-ID: <7071CE60-0204-43FD-BE58-CFC029D906FD@couchbase.com> References: <1356411203.4791.yext-apple-iphone@web181704.mail.ne1.yahoo.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_7071CE60020443FDBE58CFC029D906FDcouchbasecom_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_7071CE60020443FDBE58CFC029D906FDcouchbasecom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable On Dec 25, 2012, at 2:01 AM, Robert Newson > wrote: Scott is right that we should return well-formed error responses and not stack traces (We're not J2EE, for goodness sake) Agreed. This seems to me to be an endemic problem of Erlang programs =97 th= e pattern-matching behavior in the language is extremely convenient but res= ults in software that handles any sort of incorrect input with a generic ex= ception like =93badmatch=94. Which might be okay if the software took care = to catch all of those exceptions and map them into either app-specific exce= ptions or some kind of error codes; but none of the Erlang code I=92ve seen= (mostly just CouchDB) ever does that. One of the few pieces of Erlang code= I wrote did carefully try to catch such generic exceptions, but I was told= by the reviewer that it was =93not idiomatic=94. Someone should totally fix this particular bug. But in my experience there = are dozens of other similar ones in the CouchDB code. Coding in Erlang seem= s to breed these bugs, the same way that coding in C breeds memory smashers= . Yes, I am a little bitter about this. CouchDB has the most absurdly verbose= -but-incomprehensible log messages. I have spent/wasted many hours trying t= o make sense of them. Omitting the leading slash in the path of an HTTP request line is pretty unusual these days (because it's mandatory and almost everyone uses a library of some sort) Also agreed. IMHO anyone who doesn=92t immediately realize that the path in= an HTTP command line must begin with a slash, does not have the expertise = to be hand-crafting HTTP requests. I=92m not being snooty, I=92m just sayin= g that there are a lot of excellent HTTP libraries for every conceivable pr= ogramming language, and the only reason to avoid them is if you=92re an HTT= P boffin who needs to do something very unusual. =97Jens --_000_7071CE60020443FDBE58CFC029D906FDcouchbasecom_--