Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Refactoring of code and documentation.
[simgrid.git] / src / cxx / Environment.cxx
index 5b0ea8d..a44fd2a 100644 (file)
@@ -24,12 +24,12 @@ namespace SimGrid
                }\r
                \r
                Environment::Environment(const char* file)\r
-               throw(InvalidArgumentException);\r
+               throw(NullPointerException, InvalidArgumentException);\r
                {\r
                        // check parameters\r
                        \r
                        if(!file)\r
-                               throw InvalidParameterException("file (must not be NULL");\r
+                               throw NullPointerException("file (must not be NULL");\r
                        \r
                        struct stat statBuf = {0};\r
                                \r
@@ -65,7 +65,7 @@ namespace SimGrid
                }\r
                \r
                void Environment::load(const char* file)\r
-               throw(InvalidArgumentException, LogicException)\r
+               throw(NullPointerException, FileNotFoundException, LogicException)\r
                {\r
                        // check logic\r
                        \r
@@ -75,12 +75,12 @@ namespace SimGrid
                        // check the parameters\r
                                \r
                        if(!file)\r
-                               throw InvalidParameterException("file (must not be NULL");\r
+                               throw NullPointerException("file");\r
                        \r
                        struct stat statBuf = {0};\r
                                \r
                        if(stat(statBuff, &info) < 0 || !S_ISREG(statBuff.st_mode))\r
-                               throw InvalidParameterException("file (file not found)");\r
+                               throw FileNotFoundException(file);\r
                                        \r
                        MSG_create_environment(file);\r
                        \r
@@ -95,7 +95,7 @@ namespace SimGrid
                \r
                // Getters/setters\r
                void Environment::setFile(const char* file)\r
-               throw(InvalidArgumentException, LogicException)\r
+               throw(NullPointerException, FileNotFoundException, LogicException)\r
                {\r
                        // check logic\r
                        \r
@@ -105,12 +105,12 @@ namespace SimGrid
                        // check parameters\r
                        \r
                        if(!file)\r
-                               throw InvalidParameterException("file (must not be NULL");\r
+                               throw NullPointerException("file (must not be NULL");\r
                        \r
                        struct stat statBuf = {0};\r
                                \r
                        if(stat(statBuff, &info) < 0 || !S_ISREG(statBuff.st_mode))\r
-                               throw InvalidParameterException("file (file not found)");\r
+                               throw FileNotFoundException("file (file not found)");\r
                                \r
                        this->file = file;\r
                }\r