axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dushshantha Chandradasa" <dchandrad...@virtusa.com>
Subject FW: Exception model
Date Mon, 04 Jul 2005 10:11:52 GMT
Hi All,

 

I tried modifying the current exception model to the one that Samisa
explained below. I introduced 2 constructors to AxisException base
class; 

one is a copy constructor with following code

 

AxisException(const AxisException&
e):m_iExceptionCode(e.m_iExceptionCode), m_sMessage(e.m_sMessage){};

 

And the other one is with following code

 

AxisException(const int iExceptionCode, const char* pcMessage =
NULL):m_iExceptionCode(iExceptionCode)

            {

                        if(pcMessage)

                                    m_sMessage = std::string(pcMessage);

                        else

                                    m_sMessage = "";

            }

 

And  changed the child inherited classes accordingly.

 

But this change leads me to have C support break with following Error
messages.

 

 

       [cc] AxisExceptionC.cpp

       [cc] C:\obj\include\axis/AxisException.h(180) : error C2733:
second C lin

kage of overloaded function 'axiscCreateAxisException' not allowed

       [cc]         C:\obj\include\axis/AxisException.h(179) : see
declaration o

f 'axiscCreateAxisException'

       [cc] C:\obj\include\axis/AxisException.h(190) : error C2143:
syntax error

 : missing ',' before '*'

       [cc] C:\obj\include\axis/AxisException.h(190) : error C2059:
syntax error

 : '*'

       [cc] C:\obj\include\axis/AxisException.h(190) : error C2733:
second C lin

kage of overloaded function 'axiscCreateAxisException' not allowed

       [cc]         C:\obj\include\axis/AxisException.h(190) : see
declaration o

f 'axiscCreateAxisException'

       [cc] Generating Code...

 

BUILD FAILED

C:\axiscpp\ws-axis\c\build.xml:213: The following error occurred while
executing

 this line:

C:\axiscpp\ws-axis\c\build\buildTools.xml:85: cl failed with return code
2

 

 

Any thoughts please..

 

Regards,

Dushshantha

________________________________

From: Samisa Abeysinghe [mailto:SAbeysinghe@virtusa.com] 
Sent: Monday, July 04, 2005 11:22 AM
To: Apache AXIS C Developers List
Subject: Exception model

 

Hi All,

            PFA the class diagram of current exception model we have.

            

            Looking into the several issues we have against the
exception model, it is worth considering a re-arrangement here.

http://issues.apache.org/jira/browse/AXISCPP-707

http://issues.apache.org/jira/browse/AXISCPP-721

http://issues.apache.org/jira/browse/AXISCPP-722

 

            The idea is *very* simple here.  (basic OO stuff)

1.       We have m_sMessage and m_iExceptionCode as data members in all
the derived classes - move them to base class. Move the access methods
to the base class as well.

2.       Drop all processException() methods and move the logic to
constructor

3.       getMessage() methods in the derived classes do not get the
message rather return the message corresponding to the exception code.
Hence rename getMessage() getMessageForExceptionCode()

4.       We have "what()" in the base class to get the error message.
This is a virtual method inherited from the 'exception' class hence we
cannot change the naming. However, better to have a more sensible name
like getMessage to wrap this

5.       There are too many constructors in the derived classes, I would
like only two constructors for each class

a.       Copy constructor

b.       Constructor with 2 parameters, exception code and message, with
message defaulting to null. ExceptionClass(int code, char* msg = null)

 

Thanks,

Samisa...

 

 


Mime
View raw message