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 21890EB06 for ; Thu, 27 Dec 2012 05:14:38 +0000 (UTC) Received: (qmail 23048 invoked by uid 500); 27 Dec 2012 05:14:36 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 23009 invoked by uid 500); 27 Dec 2012 05:14:36 -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 22987 invoked by uid 99); 27 Dec 2012 05:14:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2012 05:14:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of adam.kocoloski@gmail.com designates 209.85.210.177 as permitted sender) Received: from [209.85.210.177] (HELO mail-ia0-f177.google.com) (209.85.210.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2012 05:14:29 +0000 Received: by mail-ia0-f177.google.com with SMTP id u21so7478918ial.8 for ; Wed, 26 Dec 2012 21:14:09 -0800 (PST) X-Received: by 10.50.168.40 with SMTP id zt8mr25122130igb.71.1356585249160; Wed, 26 Dec 2012 21:14:09 -0800 (PST) Received: from [192.168.0.11] (cpe-75-185-26-165.columbus.res.rr.com. [75.185.26.165]) by mx.google.com with ESMTPS id lu10sm18005390igc.15.2012.12.26.21.14.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 26 Dec 2012 21:14:07 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: Documented API does not work. From: Adam Kocoloski In-Reply-To: <7071CE60-0204-43FD-BE58-CFC029D906FD@couchbase.com> Date: Thu, 27 Dec 2012 00:14:04 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <3728B0D8-FC05-4C8E-B2C7-EE695DF2C4DA@apache.org> References: <1356411203.4791.yext-apple-iphone@web181704.mail.ne1.yahoo.com> <7071CE60-0204-43FD-BE58-CFC029D906FD@couchbase.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org On Dec 26, 2012, at 11:02 PM, Jens Alfke wrote: > Agreed. This seems to me to be an endemic problem of Erlang programs =97= the pattern-matching behavior in the language is extremely convenient = but results in software that handles any sort of incorrect input with a = generic exception 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 exceptions 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. >=20 > 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 seems to breed these bugs, the same way that coding in C breeds = memory smashers. >=20 > 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 to make sense of them. It'd be great to devote some concerted effort next year to ensuring that = all manner of bad input results in a 4xx code and a sensible response = body instead of a 5xx and a completely raw stack trace. I think we'd = stumble upon an "idiomatic" solution in the end. Adam=