Helper utility to construct, returns an Expected<..>
authorAravind Anbudurai <aru7@fb.com>
Wed, 3 May 2017 22:33:31 +0000 (15:33 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 May 2017 22:35:34 +0000 (15:35 -0700)
commit919d544e2482da913110b018b572232cdc17718a
treedfb83ded62c0c1e88b1571052fac7f983268202b
parent6f027b290a0ee1754b655b5e739ecb98e11f2f3d
Helper utility to construct, returns an Expected<..>

Summary:
folly::File's throwing constructor results in many try-catches in the callsites
or bugs where the exception is not caught.

This is a helper method to return an Expected with system_error wrapped into an
exception_wrapper.

Reviewed By: yfeldblum

Differential Revision: D4995702

fbshipit-source-id: be0e22b37c21c35bf157ada598916b05dfd32631
folly/File.cpp
folly/File.h
folly/test/FileTest.cpp