[ 
https://issues.apache.org/jira/browse/GEODE-3624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16254457#comment-16254457
 ] 

ASF GitHub Bot commented on GEODE-3624:
---------------------------------------

dgkimura commented on a change in pull request #152: GEODE-3624: Update C++ 
client exceptions to implement std::exception interface
URL: https://github.com/apache/geode-native/pull/152#discussion_r151284678
 
 

 ##########
 File path: cppcache/include/geode/ExceptionTypes.hpp
 ##########
 @@ -33,27 +33,20 @@ namespace client {
 class StackTrace;
 class CacheableString;
 
-#define _GF_EXCEPTION_DEF(x)                                            \
-  const char _exception_name_##x[] = "apache::geode::client::" #x;      \
-  class x;                                                              \
-  class CPPCACHE_EXPORT x : public apache::geode::client::Exception {   \
-   public:                                                              \
-    using Exception::Exception;                                         \
-    virtual Exception* clone() const {                                  \
-      return new x(m_message, m_stack, m_cause);                        \
-    }                                                                   \
-    virtual ~x() {}                                                     \
-    virtual const char* getName() const { return _exception_name_##x; } \
-    virtual void raise() { throw * this; }                              \
-                                                                        \
-   protected:                                                           \
-    x(const std::shared_ptr<CacheableString>& message,                  \
-      const std::shared_ptr<StackTrace>& stack,                         \
-      const std::shared_ptr<Exception>& cause)                          \
-        : Exception(message, stack, cause) {}                           \
-                                                                        \
-   private:                                                             \
-    const x& operator=(const x&);                                       \
+#define _GF_EXCEPTION_DEF(x)                                                 \
+  const char _exception_name_##x[] = "apache::geode::client::" #x;           \
+  class x;                                                                   \
+  class CPPCACHE_EXPORT x : public apache::geode::client::Exception {        \
+   public:                                                                   \
+    x(const char* msg1)                                                      \
+        : Exception(msg1) {}                                                 \
+    x(const std::string& msg1)                                               \
+        : Exception(msg1) {}                                                 \
+    virtual ~x() noexcept {}                                                 \
+    virtual const char* getName() const { return _exception_name_##x; }      \
+                                                                             \
+   private:                                                                  \
+    const x& operator=(const x&);                                            \
   }
 
 Review comment:
   I'll give it a try.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Update exceptions to more closely match standard exception interface
> --------------------------------------------------------------------
>
>                 Key: GEODE-3624
>                 URL: https://issues.apache.org/jira/browse/GEODE-3624
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>            Reporter: David Kimura
>
> Native client library should follow standard exception interface for any 
> thrown exceptions.  This means one less custom interface that a customer or 
> developer needs to understand.
> {noformat}
> namespace apache {
> namespace geode {
> namespace client {
> class Exception : public std::exception {...};
> class IllegalArgumentException : public Exception {...};
> class TransactionException : public Exception {...};
> class RollbackException : public TransactionException {...};
> // NO - class IllegalArgumentException : public Exception, public
> std::invalid_argument {...};
> // NO - class IllegalArgumentException : public std::invalid_argument {...};
> // NO - class IllegalArgumentException : public Exception, public
> TransactionException {...};
> }
> }
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to