felipealmeida pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=932b6e74635ede0bb1a1f8b86ebfc7efac724ef4

commit 932b6e74635ede0bb1a1f8b86ebfc7efac724ef4
Author: Felipe Magno de Almeida <[email protected]>
Date:   Fri Oct 9 13:54:32 2015 -0300

    eolian-cxx: Fixed possible exception escaping main
    
    Added try/catch around main to show the reason for the generation failure.
    
    @fix CID 1265600
---
 src/bin/eolian_cxx/eolian_cxx.cc | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index 38084f4..cb33de4 100644
--- a/src/bin/eolian_cxx/eolian_cxx.cc
+++ b/src/bin/eolian_cxx/eolian_cxx.cc
@@ -366,10 +366,19 @@ opts_get(int argc, char **argv)
 
 int main(int argc, char **argv)
 {
-   efl::eina::eina_init eina_init;
-   efl::eolian::eolian_init eolian_init;
-   eolian_cxx::options_type opts = opts_get(argc, argv);
-   eolian_cxx::database_load(opts);
-   eolian_cxx::run(opts);
+   try
+     {
+        efl::eina::eina_init eina_init;
+        efl::eolian::eolian_init eolian_init;
+        eolian_cxx::options_type opts = opts_get(argc, argv);
+        eolian_cxx::database_load(opts);
+        eolian_cxx::run(opts);
+     }
+   catch(std::exception const& e)
+     {
+       std::cerr << "EOLCXX: Eolian C++ failed generation for the following 
reason: " << e.what() << std::endl;
+       std::cout << "EOLCXX: Eolian C++ failed generation for the following 
reason: " << e.what() << std::endl;
+       return -1;
+     }
    return 0;
 }

-- 


Reply via email to