Merge lp:~dobey/ubuntu-app-launch/throw-less into lp:ubuntu-app-launch/16.10

Proposed by dobey
Status: Merged
Approved by: Ted Gould
Approved revision: 256
Merged at revision: 256
Proposed branch: lp:~dobey/ubuntu-app-launch/throw-less
Merge into: lp:ubuntu-app-launch/16.10
Diff against target: 23 lines (+11/-3)
1 file modified
libubuntu-app-launch/application-impl-libertine.cpp (+11/-3)
To merge this branch: bzr merge lp:~dobey/ubuntu-app-launch/throw-less
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Needs Fixing
Ted Gould (community) Approve
Review via email: mp+307062@code.launchpad.net

Commit message

Add a try/catch inside the for loop in ::list().

Description of the change

For some reason the Libertine back-end was the only one not doing this. This adds a try/catch inside the for loop for listing installed apps, as relying on the application using the API to handle exceptions from here still results in a broken listing of apps, as the loop would never complete when an exception was thrown. So we need to log and continue on, as the other back-ends do, here.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Continuous integration, rev:256
https://jenkins.canonical.com/unity-api-1/job/lp-ubuntu-app-launch-ci/107/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/790/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/796
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/604/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/604
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/604/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/604
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/604/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/604
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/604/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/604
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/604/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/604
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/604/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/604
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/604/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/604
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/604/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/604
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/604/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-ubuntu-app-launch-ci/107/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntu-app-launch/application-impl-libertine.cpp'
2--- libubuntu-app-launch/application-impl-libertine.cpp 2016-08-26 15:30:28 +0000
3+++ libubuntu-app-launch/application-impl-libertine.cpp 2016-09-28 17:18:42 +0000
4@@ -239,9 +239,17 @@
5
6 for (int j = 0; apps.get()[j] != nullptr; j++)
7 {
8- auto appid = AppID::parse(apps.get()[j]);
9- auto sapp = std::make_shared<Libertine>(appid.package, appid.appname, registry);
10- applist.push_back(sapp);
11+ try
12+ {
13+ auto appid = AppID::parse(apps.get()[j]);
14+ auto sapp = std::make_shared<Libertine>(appid.package, appid.appname, registry);
15+ applist.emplace_back(sapp);
16+ }
17+ catch (std::runtime_error& e)
18+ {
19+ g_debug("Unable to create application for libertine appname '%s': %s",
20+ apps.get()[j], e.what());
21+ }
22 }
23 }
24

Subscribers

People subscribed via source and target branches