Fixes for Try::withException
authorYedidya Feldblum <yfeldblum@fb.com>
Tue, 27 Jun 2017 21:27:31 +0000 (14:27 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 27 Jun 2017 21:35:42 +0000 (14:35 -0700)
commit258585eff14817914814310573cde2166fcc068f
treeeac2cff646a3c94a31d6858fa5cb026ff6de369d
parentb3ab0cc4e44eedfd83699a58befce5daebb7d228
Fixes for Try::withException

Summary:
[Folly] Fixes for `Try::withException`.

* Fix the overload with the exception type specified so that the specified exception type is checked. A mismatch between the specified exception type and the parameter type of the passed invokable will result in the expected compiler error.
* Add an overload where the exception type is deduced intentionally, as opposed to accidentally.

Of course, these simply forward to their corresponding `exception_wrapper::withException` overloads.

Reviewed By: ericniebler

Differential Revision: D5216691

fbshipit-source-id: 7e85c906c3aa17dfede6e0980c6ac8bf75034073
folly/Try.h
folly/test/TryTest.cpp