From: Claudio V. C. <ro...@us...> - 2005-05-22 06:14:32
|
Build Version : T2.0.0.10976 Firebird 2.0 Alpha 2 (writeBuildNum.sh,v 1.10987 2005/05/22 06:13:48 robocop Exp ) Update of /cvsroot/firebird/firebird2/src/jrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4214/src/jrd Modified Files: exe.cpp Log Message: Fix SF Bug #494981. If we can print the name of the exception, we do. Index: exe.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/exe.cpp,v retrieving revision 1.147 retrieving revision 1.148 diff -b -U3 -r1.147 -r1.148 --- exe.cpp 17 May 2005 18:19:53 -0000 1.147 +++ exe.cpp 22 May 2005 06:13:52 -0000 1.148 @@ -3696,7 +3696,8 @@ const TEXT* s; - switch (exception->xcp_type) { + switch (exception->xcp_type) + { case xcp_sql_code: ERR_post(isc_sqlerr, isc_arg_number, exception->xcp_code, 0); @@ -3712,15 +3713,30 @@ ERR_post(exception->xcp_code, 0); case xcp_xcp_code: + // CVC: If we have the exception name, use it instead of the number. + // Solves SF Bug #494981. MET_lookup_exception(tdbb, exception->xcp_code, name, temp, sizeof(temp)); if (message[0]) s = message; else if (temp[0]) s = temp; - else if (name.length()) - s = name.c_str(); + //else if (name.length()) + // s = name.c_str(); else s = NULL; + + if (name.length()) + { + if (s) + ERR_post(isc_except2, + isc_arg_string, ERR_cstring(name.c_str()), + isc_arg_gds, isc_random, isc_arg_string, ERR_cstring(s), + 0); + else + ERR_post(isc_except2, isc_arg_string, ERR_cstring(name.c_str()), 0); + } + else + { if (s) ERR_post(isc_except, isc_arg_number, exception->xcp_code, @@ -3729,6 +3745,7 @@ else ERR_post(isc_except, isc_arg_number, exception->xcp_code, 0); } + } } |