--- parser3/src/classes/void.C 2001/11/05 11:46:21 1.13 +++ parser3/src/classes/void.C 2002/04/10 09:53:14 1.18 @@ -1,10 +1,10 @@ /** @file Parser: @b VOID parser class. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) + Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) - $Id: void.C,v 1.13 2001/11/05 11:46:21 paf Exp $ + $Id: void.C,v 1.18 2002/04/10 09:53:14 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 - throw Exception(0, 0, + throw Exception("parser.runtime", &statement_string, "must return nothing"); } @@ -67,25 +67,20 @@ private: static void _sql(Request& r, const String& method_name, MethodParams *params) { Pool& pool=r.pool(); - if(!r.connection) - throw Exception(0, 0, - &method_name, - "without connect"); - Value& statement=params->as_junction(0, "statement must be code"); Temp_lang temp_lang(r, String::UL_SQL); - const String& statement_string=r.process(statement).as_string(); + const String& statement_string=r.process_to_string(statement); const char *statement_cstr= - statement_string.cstr(String::UL_UNSPECIFIED, r.connection); + statement_string.cstr(String::UL_UNSPECIFIED, r.connection(&method_name)); Void_sql_event_handlers handlers(pool, statement_string); try { - r.connection->query( + r.connection(&method_name)->query( statement_cstr, 0, 0, handlers); } catch(const Exception& e) { // more specific source [were url] - throw Exception(e.type(), e.code(), + throw Exception("sql.execute", &statement_string, "%s", e.comment()); }