[Merge] lp:~mandel/trust-store/handle-exceptions into lp:trust-store

Ken VanDine ken.vandine at canonical.com
Thu Aug 27 14:06:25 UTC 2015


Review: Needs Fixing

Looks good, just fix the white space I commented on inline.

Diff comments:

> === modified file 'src/core/trust/daemon.cpp'
> --- src/core/trust/daemon.cpp	2015-08-20 17:46:04 +0000
> +++ src/core/trust/daemon.cpp	2015-08-27 13:49:03 +0000
> @@ -101,12 +103,46 @@
>          // We immediate execute the io_service instance
>          std::thread worker1
>          {
> -            std::thread{[this]() { io_service.run(); }}
> +            std::thread{[this]() {
> +                while(true)
> +                {
> +                    try
> +                    {
> +                        io_service.run();
> +                        break; // run() exited normally
> +                    }
> +                    catch (const std::exception& e)
> +                    {
> +                        LOG(WARNING) << e.what();
> +                    }
> +                    catch (...)
> +                    {
> +                        LOG(WARNING) << "Unexpected exception was raised by the bus executor";
> +                    }
> +                } // while
> +            }} // thread
>          };
>  
>          std::thread worker2
>          {
> -            std::thread{[this]() { io_service.run(); }}
> +                        std::thread{[this]() {

Please clean up the white space

> +                while(true)
> +                {
> +                    try
> +                    {
> +                        io_service.run();
> +                        break; // run() exited normally
> +                    }
> +                    catch (const std::exception& e)
> +                    {
> +                        LOG(WARNING) << e.what();
> +                    }
> +                    catch (...)
> +                    {
> +                        LOG(WARNING) << "Unexpected exception was raised by the bus executor";
> +                    }
> +                } // while
> +            }} // thread
>          };
>      };
>  


-- 
https://code.launchpad.net/~mandel/trust-store/handle-exceptions/+merge/257690
Your team Ubuntu Phablet Team is subscribed to branch lp:trust-store.



More information about the Ubuntu-reviews mailing list