summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/MemoryFileTest.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-08-22 16:07:15 -0700
committerTom Cherry <tomcherry@google.com>2017-08-23 11:04:32 -0700
commit130e3d7204d2b2d3d2ba956c3243fbc0fb1cabe4 (patch)
tree1aeef41d7c988db4d02026af31a3290e9288245f /libunwindstack/tests/MemoryFileTest.cpp
parent6de21f11125941ea1b94fdeec754bacea3916fd5 (diff)
init: pass errors from one Result<T> to another better
Result<T> currently has two problems, 1) A failing Result<T> cannot be easily constructed from a Result<U>'s error. 2) errno is lost when passing .error() through multiple Result<T>'s This change fixes both problems having Result<T>::error() return a ResultError class that contains the std::string error message and int errno. It additionally has ostream operators to continue to allow printing the error string directly to an ostream and also to pass the errno through to another Result<T> class via Error() creation. Lastly, it provides a new constructor for Result<T> for ResultError, such that a Result<T> can be constructed from Result<U>::error(). Test: boot bullhead, init unit tests Change-Id: Id9614b727cdabd2f5498b0da0e598e9aff7d9ae0
Diffstat (limited to 'libunwindstack/tests/MemoryFileTest.cpp')
0 files changed, 0 insertions, 0 deletions