You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2004/05/14 14:19:27 UTC

cvs commit: ws-axis/c/src/wsdd AxisWsddException.h

damitha     2004/05/14 05:19:27

  Modified:    c/include/axis/server AxisException.h
               c/src/common AxisConfigException.h AxisException.cpp
               c/src/soap AxisSoapException.h
               c/src/wsdd AxisWsddException.h
  Added:       c/src/engine AxisEngineException.cpp AxisEngineException.h
  Log:
  
  
  Revision  Changes    Path
  1.6       +39 -13    ws-axis/c/include/axis/server/AxisException.h
  
  Index: AxisException.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/AxisException.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AxisException.h	6 May 2004 03:55:18 -0000	1.5
  +++ AxisException.h	14 May 2004 12:19:27 -0000	1.6
  @@ -23,6 +23,10 @@
   
   #include <string>
   #include <exception>
  +#include <new>
  +#include <typeinfo>
  +#include <stdexcept>
  +#include <ios>
   using namespace std;
   
   
  @@ -30,7 +34,26 @@
   #define AXISC_TRY try {
   #define AXISC_CATCH(X) } catch (X) { 
   #define AXISC_ENDCATCH }
  +
   #define AXISC_THROW(X) throw AxisException(X)
  +#define THROW_AXIS_EXCEPTION() throw AxisException()
  +#define THROW_AXIS_EXCEPTION(X) throw AxisException(X)
  +#define THROW_AXIS_CONFIG_EXCEPTION() throw AxisConfigException()
  +#define THROW_AXIS_CONFIG_EXCEPTION(X) throw AxisConfigException(X)
  +#define THROW_AXIS_SOAP_EXCEPTION() throw AxisSoapException()
  +#define THROW_AXIS_SOAP_EXCEPTION(X) throw AxisSoapException(X)
  +#define THROW_AXIS_WSDD_EXCEPTION() throw AxisWsddException()
  +#define THROW_AXIS_WSDD_EXCEPTION(X) throw AxisWsddException(X)
  +#define THROW_AXIS_BAD_ALLOC() throw std::bad_alloc
  +#define THROW_AXIS_BAD_CAST() throw std::bad_cast
  +#define THROW_AXIS_BAD_TYPEID() throw std::bad_typeid
  +#define THROW_AXIS_BAD_EXCEPTION() throw std::bad_exception
  +#define THROW_AXIS_OUT_OF_RANGE(X) throw std::out_of_range
  +#define THROW_AXIS_INVALID_ARGUMENT(X) throw std::invalid_argument
  +#define THROW_AXIS_OVERFLOW_ERROR(X) throw std::overflow_error
  +#define THROW_AXIS_IOS_BASE_FAILURE(X) throw std::ios_base::failure
  +
  +
   #define AXISC_THROW_SAME throw;
   #else
   #define AXISC_TRY 
  @@ -89,7 +112,10 @@
      /*
       * Exceptions that appear afterwords are not related to Soap faults
       */
  -  
  +    AXISC_SOAP_EXCEPTION,
  +    AXISC_WSDD_EXCEPTION,
  +    AXISC_CONFIG_EXCEPTION,
  +    AXISC_ENGINE_EXCEPTION,
       AXISC_ERROR_NONE,
       AXISC_TEST_EXCEPTION,
       AXISC_RECEPTION_ERROR,
  @@ -102,20 +128,20 @@
   class AxisException :public exception
   {
   
  -  public:
  -  AxisException(int exceptionCode);
  -  AxisException(exception* e);
  -  AxisException(exception* e, int exceptionCode);
  -  virtual ~AxisException() throw();
  -  const char* what() const throw();
  -  const int getExceptionCode();
  -  string getMessage(exception* e);
  -  string getMessage(int e);    
  +public:
  +    AxisException(int iExceptionCode);
  +    AxisException(exception* e);
  +    AxisException(exception* e, int iExceptionCode);
  +    virtual ~AxisException() throw();
  +    virtual const char* what() throw();
  +    virtual const int getExceptionCode();
  +    virtual const string getMessage(exception* e);
  +    virtual const string getMessage(int iExceptionCode);    
   
  -  private:
  +private:
       void processException(exception* e);
  -    void processException(exception* e, int exceptionCode);
  -    void processException(int e);
  +    void processException(exception* e, int iExceptionCode);
  +    void processException(int iExceptionCode);
       string m_sMessage;
       int m_iExceptionCode;
   };
  
  
  
  1.2       +17 -6     ws-axis/c/src/common/AxisConfigException.h
  
  Index: AxisConfigException.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisConfigException.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AxisConfigException.h	13 May 2004 12:18:31 -0000	1.1
  +++ AxisConfigException.h	14 May 2004 12:19:27 -0000	1.2
  @@ -29,12 +29,23 @@
   class AxisConfigException :public AxisException
   {
   
  -  public:
  -  AxisConfigException();
  -  AxisConfigException(int exceptionCode);
  -  AxisConfigException(exception* e);
  -  AxisConfigException(exception* e, int exceptionCode);
  -  virtual ~AxisConfigException() throw();
  +public:
  +    AxisConfigException();
  +    AxisConfigException(int iExceptionCode);
  +    AxisConfigException(exception* e);
  +    AxisConfigException(exception* e, int iExceptionCode);
  +    virtual ~AxisConfigException() throw();
  +    const char* what() throw();
  +    const int getExceptionCode();
  +    const string getMessage(exception* e);
  +    const string getMessage(int iExceptionCode);
  +                                                                                                                             
  +private:
  +    void processException(exception* e);
  +    void processException(exception* e, int iExceptionCode);
  +    void processException(int iExceptionCode);
  +    string m_sMessage;
  +    int m_iExceptionCode;
   };
   
   #endif
  
  
  
  1.15      +4 -4      ws-axis/c/src/common/AxisException.cpp
  
  Index: AxisException.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisException.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AxisException.cpp	6 May 2004 03:55:18 -0000	1.14
  +++ AxisException.cpp	14 May 2004 12:19:27 -0000	1.15
  @@ -49,12 +49,12 @@
       m_sMessage = getMessage (e);
   }
   
  -void AxisException::processException (int iExceptionCode)
  +void AxisException::processException(int iExceptionCode)
   {
       m_sMessage = getMessage (iExceptionCode);
   }
   
  -string AxisException::getMessage (exception* objException)
  +const string AxisException::getMessage (exception* objException)
   {
       string sMessage = objException->what();
       /* to do */
  @@ -86,7 +86,7 @@
       return sMessage;
   }
   
  -string AxisException::getMessage (int iExceptionCode)
  +const string AxisException::getMessage (int iExceptionCode)
   {
       string sMessage;
       switch(iExceptionCode)
  @@ -189,7 +189,7 @@
   
   }
   
  -const char* AxisException::what() const throw ()
  +const char* AxisException::what() throw ()
   {
       return m_sMessage.c_str ();
   }
  
  
  
  1.1                  ws-axis/c/src/engine/AxisEngineException.cpp
  
  Index: AxisEngineException.cpp
  ===================================================================
  /* -*- C++ -*- */
  /*
   *   Copyright 2003-2004 The Apache Software Foundation.
   *
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *   limitations under the License.
   *
   * 
   * @author  Damitha Kumarage (damitha@opensource.lk, damitha@jkcsworld.com)
   *
   */
  
  #include <axis/server/AxisEngineException.h>
  #include <exception>
  using namespace std;
  
  /**
   *    Default when no parameter passed. When thrown with no parameter
   *    more general AXISC_ENGINE_EXCEPTION is assumed.
  */
  AxisEngineException::AxisEngineException()
  {
      processException(AXISC_ENGINE_EXCEPTION);
  }
  
  AxisEngineException::AxisEngineException (int iExceptionCode)
  {
      m_iExceptionCode = iExceptionCode;
      processException (iExceptionCode);
  }
  
  AxisEngineException::AxisEngineException (exception* e)
  {
      processException (e);
  }
  
  AxisEngineException::AxisEngineException (exception* e, int iExceptionCode)
  {
      processException (e, iExceptionCode);
  }
  
  AxisEngineException::~AxisEngineException() throw ()
  {
  
  }
  
  
  
  
  1.1                  ws-axis/c/src/engine/AxisEngineException.h
  
  Index: AxisEngineException.h
  ===================================================================
  /*
   *   Copyright 2003-2004 The Apache Software Foundation.
   *
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *   limitations under the License.
   *
   *
   *   @author Damitha Kumarage (damitha@opensource.lk, damitha@jkcsworld.com)
   *
   */
   
  #ifndef __AXISENGINEEXCEPTION_H_OF_AXIS_INCLUDED_
  #define __AXISENGINEEXCEPTION_H_OF_AXIS_INCLUDED_
  
  #include <string>
  #include <exception>
  #include <axis/server/AxisException.h>
  using namespace std;
  
  class AxisEngineException :public AxisException
  {
  
  public:
      AxisEngineException();
      AxisEngineException(int iExceptionCode);
      AxisEngineException(exception* e);
      AxisEngineException(exception* e, int iExceptionCode);
      virtual ~AxisEngineException() throw();
      const char* what() throw();
      const int getExceptionCode();
      const string getMessage(exception* e);
      const string getMessage(int iExceptionCode);
                                                                                                                               
  private:
      void processException(exception* e);
      void processException(exception* e, int iExceptionCode);
      void processException(int e);
      string m_sMessage;
      int m_iExceptionCode;
  };
  
  #endif
  
  
  
  
  1.2       +16 -5     ws-axis/c/src/soap/AxisSoapException.h
  
  Index: AxisSoapException.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/AxisSoapException.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AxisSoapException.h	13 May 2004 12:18:31 -0000	1.1
  +++ AxisSoapException.h	14 May 2004 12:19:27 -0000	1.2
  @@ -30,11 +30,22 @@
   {
   
   public:
  -  AxisSoapException();
  -  AxisSoapException(int exceptionCode);
  -  AxisSoapException(exception* e);
  -  AxisSoapException(exception* e, int exceptionCode);
  -  virtual ~AxisSoapException() throw();
  +    AxisSoapException();
  +    AxisSoapException(int iExceptionCode);
  +    AxisSoapException(exception* e);
  +    AxisSoapException(exception* e, int iExceptionCode);
  +    virtual ~AxisSoapException() throw();
  +    const char* what() throw();
  +    const int getExceptionCode();
  +    const string getMessage(exception* e);
  +    const string getMessage(int iExceptionCode);
  +                                                                                                                             
  +private:
  +    void processException(exception* e);
  +    void processException(exception* e, int iExceptionCode);
  +    void processException(int iExceptionCode);
  +    string m_sMessage;
  +    int m_iExceptionCode;
   };
   
   #endif
  
  
  
  1.2       +17 -6     ws-axis/c/src/wsdd/AxisWsddException.h
  
  Index: AxisWsddException.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdd/AxisWsddException.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AxisWsddException.h	13 May 2004 12:18:31 -0000	1.1
  +++ AxisWsddException.h	14 May 2004 12:19:27 -0000	1.2
  @@ -29,12 +29,23 @@
   class AxisWsddException :public AxisException
   {
   
  -  public:
  -  AxisWsddException();
  -  AxisWsddException(int exceptionCode);
  -  AxisWsddException(exception* e);
  -  AxisWsddException(exception* e, int exceptionCode);
  -  virtual ~AxisWsddException() throw();
  +public:
  +    AxisWsddException();
  +    AxisWsddException(int iExceptionCode);
  +    AxisWsddException(exception* e);
  +    AxisWsddException(exception* e, int iExceptionCode);
  +    virtual ~AxisWsddException() throw();
  +    const char* what() throw();
  +    const int getExceptionCode();
  +    const string getMessage(exception* e);
  +    const string getMessage(int iExceptionCode);
  +                                                                                                                             
  +private:
  +    void processException(exception* e);
  +    void processException(exception* e, int iExceptionCode);
  +    void processException(int iExceptionCode);
  +    string m_sMessage;
  +    int m_iExceptionCode;
   };
   
   #endif