genCSR: Fix to catch InvalidArgument exception

Currently unit test cases (TestGenerateCSRwithUnsupportedKeyPairAlgorithm and
TestRSAKeyWithUnsupportedKeyBitLength) are failed with below mentioned error when
using unsupported values to generate CSR. The problem is, did not catch the thrown
exception for handling unsupported values. So, In this patch added catch block to
capture the thrown exception.

Error:
    C++ exception with description "xyz.openbmc_project.Common.Error.InvalidArgument:
    Invalid argument was given." thrown in the test body.

TestedBy:
- Ran Unit Test cases.

Signed-off-by: Ramesh Iyyar <rameshi1@in.ibm.com>
Change-Id: I4ec0b8a926dacd4c3fb6751e48502776d5cc436b
diff --git a/certs_manager.cpp b/certs_manager.cpp
index 8541656..f833a95 100644
--- a/certs_manager.cpp
+++ b/certs_manager.cpp
@@ -267,6 +267,13 @@
             exit(EXIT_FAILURE);
             commit<InternalFailure>();
         }
+        catch (const InvalidArgument& e)
+        {
+            // commit the error reported in child process and exit
+            // Callback method from SDEvent Loop looks for exit status
+            exit(EXIT_FAILURE);
+            commit<InvalidArgument>();
+        }
     }
     else
     {