int main(int argc, char** argv) {
ci::PkgmgrInstaller pkgmgr_installer;
- auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &pkgmgr_installer);
+ try {
+ auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &pkgmgr_installer);
- ci::InstallerRunner runner(
- std::make_unique<ci::UnifiedInstallerFactory>(), pkgmgr);
- ci::AppInstaller::Result result = runner.Run();
-
- return (result == ci::AppInstaller::Result::OK) ? 0 : 1;
+ ci::InstallerRunner runner(
+ std::make_unique<ci::UnifiedInstallerFactory>(), pkgmgr);
+ ci::AppInstaller::Result result = runner.Run();
+ return (result == ci::AppInstaller::Result::OK) ? 0 : 1;
+ } catch(...) {
+ LOG(ERROR) << "Exception occured";
+ return 1;
+ }
}
int main(int argc, char** argv) {
ci::PkgmgrInstaller pkgmgr_installer;
- auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &pkgmgr_installer);
+ try {
+ auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &pkgmgr_installer);
- ci::InstallerRunner runner(std::make_unique<CrashInstallerFactory>(), pkgmgr);
- ci::AppInstaller::Result result = runner.Run();
+ ci::InstallerRunner runner(
+ std::make_unique<CrashInstallerFactory>(), pkgmgr);
+ ci::AppInstaller::Result result = runner.Run();
- return (result == ci::AppInstaller::Result::OK) ? 0 : 1;
+ return (result == ci::AppInstaller::Result::OK) ? 0 : 1;
+ } catch(...) {
+ LOG(ERROR) << "Exception occured";
+ return 1;
+ }
}