Mercurial > hg > audiodb
diff common.cpp @ 355:94c18f128ce8
First version of the API, committed to the main trunk. Thanks Christophe, for all the help!
author | mas01ik |
---|---|
date | Wed, 12 Nov 2008 10:21:06 +0000 |
parents | c93be2f3a674 |
children | 64d5de8b1a68 |
line wrap: on
line diff
--- a/common.cpp Fri Nov 07 12:48:26 2008 +0000 +++ b/common.cpp Wed Nov 12 10:21:06 2008 +0000 @@ -50,7 +50,9 @@ } void audioDB::error(const char* a, const char* b, const char *sysFunc) { - if(isServer) { + + + if(isServer) { /* FIXME: I think this is leaky -- we never delete err. actually deleting it is tricky, though; it gets placed into some soap-internal struct with uncertain extent... -- CSR, @@ -60,14 +62,18 @@ /* FIXME: actually we could usefully do with a properly structured type, so that we can throw separate faultstring and details. -- CSR, 2007-10-01 */ - throw(err); - } else { - std::cerr << a << ": " << b << std::endl; - if (sysFunc) { - perror(sysFunc); + throw(err); + } else if (UseApiError){ + apierrortemp=-1; + throw(apierrortemp); + } else { + std::cerr << a << ": " << b << std::endl; + if (sysFunc) { + perror(sysFunc); + } + exit(1); } - exit(1); - } + } void audioDB::initRNG() {