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
1=== modified file 'src/common/sharedlibrary/shared_library_prober.cpp'
2--- src/common/sharedlibrary/shared_library_prober.cpp 2015-06-17 05:20:42 +0000
3+++ src/common/sharedlibrary/shared_library_prober.cpp 2015-07-10 08:22:42 +0000
4@@ -57,7 +57,7 @@
5 boost::filesystem::directory_iterator iterator{path, ec};
6 if (ec)
7 {
8- std::system_error error{boost_to_std_error(ec)};
9+ std::system_error error(boost_to_std_error(ec), path);
10 report.probing_failed(path, error);
11 throw error;
12 }
13
14=== modified file 'tests/unit-tests/test_shared_library_prober.cpp'
15--- tests/unit-tests/test_shared_library_prober.cpp 2015-06-18 02:46:16 +0000
16+++ tests/unit-tests/test_shared_library_prober.cpp 2015-07-10 08:22:42 +0000
17@@ -84,6 +84,23 @@
18 std::system_error);
19 }
20
21+TEST_F(SharedLibraryProber, exception_mentions_missing_path_name)
22+{
23+ bool thrown = false;
24+
25+ try
26+ {
27+ mir::libraries_for_path("/panacea", null_report);
28+ }
29+ catch (std::system_error& err)
30+ {
31+ thrown = true;
32+ EXPECT_THAT(err.what(), testing::HasSubstr("/panacea"));
33+ }
34+
35+ EXPECT_TRUE(thrown);
36+}
37+
38 TEST_F(SharedLibraryProber, non_existent_path_raises_ENOENT_error)
39 {
40 try

Subscribers

People subscribed via source and target branches