--- parser3/src/main/pa_exception.C 2001/10/22 08:27:44 1.21 +++ parser3/src/main/pa_exception.C 2001/11/15 18:21:31 1.25 @@ -2,14 +2,18 @@ Parser: exception 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: pa_exception.C,v 1.21 2001/10/22 08:27:44 parser Exp $ + $Id: pa_exception.C,v 1.25 2001/11/15 18:21:31 paf Exp $ */ #include "pa_common.h" #include "pa_exception.h" +Exception::Exception() { + ftype=fcode=fproblem_source=0; + fcomment[0]=0; +} Exception::Exception(const String *atype, const String *acode, const String *aproblem_source, const char *comment_fmt, ...) { @@ -21,15 +25,14 @@ Exception::Exception(const String *atype if(comment_fmt) { va_list args; va_start(args, comment_fmt); - fcomment=(char *)malloc(MAX_STRING); vsnprintf(fcomment, MAX_STRING, comment_fmt, args); va_end(args); } else - fcomment=0; + fcomment[0]=0; } #ifdef XML -void Exception::convert(Pool& pool, const String *source, const XSLException& e) { +void Exception::provide_source(Pool& pool, const String *source, const XSLException& e) { if(e.getURI().empty()) throw Exception(0, 0, source, @@ -50,14 +53,14 @@ void Exception::convert(Pool& pool, cons ); } -void Exception::convert(Pool& pool, const String *source, const SAXException& e) { +void Exception::provide_source(Pool& pool, const String *source, const SAXException& e) { throw Exception(0, 0, source, "%s", pool.transcode_cstr(XalanDOMString(e.getMessage())) // message for exception ); } -void Exception::convert(Pool& pool, const String *source, const SAXParseException& e) { +void Exception::provide_source(Pool& pool, const String *source, const SAXParseException& e) { throw Exception(0, 0, source, "%s. %s(%d:%d)", @@ -68,7 +71,7 @@ void Exception::convert(Pool& pool, cons } -void Exception::convert(Pool& pool, const String *source, const XMLException& e) { +void Exception::provide_source(Pool& pool, const String *source, const XMLException& e) { throw Exception(0, 0, source, "%s (%s). %s(%d)'", @@ -81,7 +84,7 @@ void Exception::convert(Pool& pool, cons ); } -void Exception::convert(Pool& pool, const String *source, const XalanDOMException& e) { +void Exception::provide_source(Pool& pool, const String *source, const XalanDOMException& e) { const char *s; int code=(int)e.getExceptionCode(); switch(code) {