diff --git a/include/dynamic-graph/exception-abstract.h b/include/dynamic-graph/exception-abstract.h
index 5d3a5e7a501194c2b09de580d443ea40e2dbe77b..8bf3c2a67a78c67dd7c51092c0febf437eb13161 100644
--- a/include/dynamic-graph/exception-abstract.h
+++ b/include/dynamic-graph/exception-abstract.h
@@ -78,7 +78,7 @@ public:
   virtual ~ExceptionAbstract( void ) throw() {}
 
   /**  Access to the error code. */
-  int getCode (void);
+  int getCode () const;
 
   /** Reference access to the error message (can be empty). */
   const std::string& getStringMessage (void) const;
diff --git a/src/exception/exception-abstract.cpp b/src/exception/exception-abstract.cpp
index b8f16ab1d2292801ab7fcb2cd32546e739f49fec..f37ef50ad8f00c8a7f163f8e7ae585c234633d00 100644
--- a/src/exception/exception-abstract.cpp
+++ b/src/exception/exception-abstract.cpp
@@ -59,8 +59,8 @@ getStringMessage (void) const
     return this->message;
 }
 
-int ExceptionAbstract::
-getCode (void)
+int
+ExceptionAbstract::getCode () const
 {
     return this->code;
 }