--- parser3/src/classes/void.C 2001/10/08 16:42:06 1.11 +++ parser3/src/classes/void.C 2001/11/05 11:46:21 1.13 @@ -2,9 +2,9 @@ Parser: @b VOID parser class. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Author: Alexander Petrosyan (http://paf.design.ru) - $Id: void.C,v 1.11 2001/10/08 16:42:06 parser Exp $ + $Id: void.C,v 1.13 2001/11/05 11:46:21 paf Exp $ */ #include "classes.h" @@ -52,7 +52,7 @@ public: void add_column(void *ptr, size_t size) { /* ignore */ } void before_rows() { // there are some result rows, which is wrong - PTHROW(0, 0, + throw Exception(0, 0, &statement_string, "must return nothing"); } @@ -68,7 +68,7 @@ static void _sql(Request& r, const Strin Pool& pool=r.pool(); if(!r.connection) - PTHROW(0, 0, + throw Exception(0, 0, &method_name, "without connect"); @@ -79,20 +79,16 @@ static void _sql(Request& r, const Strin const char *statement_cstr= statement_string.cstr(String::UL_UNSPECIFIED, r.connection); Void_sql_event_handlers handlers(pool, statement_string); - bool need_rethrow=false; Exception rethrow_me; - PTRY { + try { r.connection->query( statement_cstr, 0, 0, handlers); + } catch(const Exception& e) { + // more specific source [were url] + throw Exception(e.type(), e.code(), + &statement_string, + "%s", e.comment()); } - PCATCH(e) { - rethrow_me=e; need_rethrow=true; - } - PEND_CATCH - if(need_rethrow) - PTHROW(rethrow_me.type(), rethrow_me.code(), - &statement_string, // setting more specific source [were url] - rethrow_me.comment()); } // constructor