Author: mturk Date: Sat Apr 18 15:03:35 2009 New Revision: 766335 URL: http://svn.apache.org/viewvc?rev=766335&view=rev Log: Do not thow message in case it's irrelevant
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/error.c Modified: commons/sandbox/runtime/trunk/src/main/native/shared/error.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/error.c?rev=766335&r1=766334&r2=766335&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/shared/error.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/shared/error.c Sat Apr 18 15:03:35 2009 @@ -110,10 +110,16 @@ const char *file, int line, acr_trowclass_e clazz, int err) { - char buf[ACR_MBUFF_SIZ]; - - ACR_ThrowExceptionA(env, file, line, clazz, - ACR_GetErrorString(err, buf, ACR_MBUFF_LEN)); + if (err == ACR_SUCCESS || err == ACR_EGENERAL) { + /* Just throw an exception without error message. + */ + ACR_ThrowExceptionA(env, file, line, clazz, NULL); + } + else { + char buf[ACR_MBUFF_SIZ]; + ACR_ThrowExceptionA(env, file, line, clazz, + ACR_GetErrorString(err, buf, ACR_MBUFF_LEN)); + } } /* @@ -431,6 +437,7 @@ ACR_DECLARE(char *) ACR_GetErrorString(int statcode, char *buf, acr_size_t bufsize) { + if (statcode < ACR_OS_START_ERROR) { return native_strerror(statcode, buf, bufsize); }