Mir

Merge lp:~vanvugt/mir/fix-1473268 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 2738
Proposed branch: lp:~vanvugt/mir/fix-1473268
Merge into: lp:mir
Diff against target: 40 lines (+18/-1)
2 files modified
src/common/sharedlibrary/shared_library_prober.cpp (+1/-1)
tests/unit-tests/test_shared_library_prober.cpp (+17/-0)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1473268
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Cemil Azizoglu (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+264387@code.launchpad.net

Commit message

Improved shared library loading error messages to include the path
that can't be found. Instead of simply "No such file or directory",
you will now see "/the/path/tried/: No such file or directory".
(LP: #1473268)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Ok

review: Approve
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Looks like a much better error.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/common/sharedlibrary/shared_library_prober.cpp'
--- src/common/sharedlibrary/shared_library_prober.cpp 2015-06-17 05:20:42 +0000
+++ src/common/sharedlibrary/shared_library_prober.cpp 2015-07-10 08:22:42 +0000
@@ -57,7 +57,7 @@
57 boost::filesystem::directory_iterator iterator{path, ec};57 boost::filesystem::directory_iterator iterator{path, ec};
58 if (ec)58 if (ec)
59 {59 {
60 std::system_error error{boost_to_std_error(ec)};60 std::system_error error(boost_to_std_error(ec), path);
61 report.probing_failed(path, error);61 report.probing_failed(path, error);
62 throw error;62 throw error;
63 }63 }
6464
=== modified file 'tests/unit-tests/test_shared_library_prober.cpp'
--- tests/unit-tests/test_shared_library_prober.cpp 2015-06-18 02:46:16 +0000
+++ tests/unit-tests/test_shared_library_prober.cpp 2015-07-10 08:22:42 +0000
@@ -84,6 +84,23 @@
84 std::system_error);84 std::system_error);
85}85}
8686
87TEST_F(SharedLibraryProber, exception_mentions_missing_path_name)
88{
89 bool thrown = false;
90
91 try
92 {
93 mir::libraries_for_path("/panacea", null_report);
94 }
95 catch (std::system_error& err)
96 {
97 thrown = true;
98 EXPECT_THAT(err.what(), testing::HasSubstr("/panacea"));
99 }
100
101 EXPECT_TRUE(thrown);
102}
103
87TEST_F(SharedLibraryProber, non_existent_path_raises_ENOENT_error)104TEST_F(SharedLibraryProber, non_existent_path_raises_ENOENT_error)
88{105{
89 try106 try

Subscribers

People subscribed via source and target branches