X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzexcept.cpp;h=cef62979afe358891493a6ec3c7bdd41eaa46f9e;hb=64248c6114c42391aa85cf70958707b5acdc3482;hp=e37edfccf09c04b15da10d5365ba6dc501a2cce0;hpb=be5e415f7ca4d3b84d09e3f98b2c1bda629570c5;p=yazpp-moved-to-github.git diff --git a/zoom/zexcept.cpp b/zoom/zexcept.cpp index e37edfc..cef6297 100644 --- a/zoom/zexcept.cpp +++ b/zoom/zexcept.cpp @@ -1,4 +1,4 @@ -// $Header: /home/cvsroot/yaz++/zoom/zexcept.cpp,v 1.2 2002-10-08 23:57:29 mike Exp $ +// $Header: /home/cvsroot/yaz++/zoom/zexcept.cpp,v 1.6 2002-11-12 22:43:56 mike Exp $ // Z39.50 Exception classes @@ -6,7 +6,7 @@ #include // for strerror(), strlen(), strcpy() #include // for sprintf() #include -#include "zoom++.h" +#include "zoom.h" namespace ZOOM { @@ -26,14 +26,10 @@ namespace ZOOM { - systemException::systemException() : exception::exception(errno){ + systemException::systemException() : exception(errno){ code = errno; } - int systemException::errcode() const { - return code; - } - const char *systemException::errmsg() const { return strerror(code); } @@ -41,7 +37,7 @@ namespace ZOOM { bib1Exception::bib1Exception(int errcode, const char *addinfo) : - exception::exception(errcode) { + exception(errcode) { info = new char[strlen(addinfo)+1]; strcpy((char*) info, addinfo); //fprintf(stderr, "made new bib1Exception 0x%lx (%d, 0x%lx=%s)\n", @@ -50,7 +46,7 @@ namespace ZOOM { #if 0 bib1Exception::bib1Exception(bib1Exception& src) : - exception::exception(src) { + exception(src) { code = src.code; info = new char[strlen(src.info)+1]; strcpy((char*) info, src.info); @@ -69,10 +65,6 @@ namespace ZOOM { // or less work -- it just leaks memory. } - int bib1Exception::errcode() const { - return code; - } - const char *bib1Exception::errmsg() const { return diagbib1_str(code); } @@ -84,17 +76,13 @@ namespace ZOOM { queryException::queryException(int qtype, const char *source) : - exception::exception(qtype) { + exception(qtype) { q = new char[strlen(source)+1]; strcpy((char*) q, source); } queryException::~queryException() { - delete q; - } - - int queryException::errcode() const { - return code; + //delete q; // ### see comment on bib1Exception destructor } const char *queryException::errmsg() const {