fix exceptionStr to work for derived classes of std::exception
authorMarc Horowitz <mhorowitz@fb.com>
Thu, 4 Sep 2014 02:32:36 +0000 (19:32 -0700)
committerSara Golemon <sgolemon@fb.com>
Tue, 9 Sep 2014 21:22:23 +0000 (14:22 -0700)
commitaccce27e08a353124c9962704a3661bbccf1d942
tree8c28f3ed6aa3e58f2c8255b0571b3073b816b7ff
parentc9f5e53987f2e67c234546b576b15cce4bdfacbe
fix exceptionStr to work for derived classes of std::exception

Summary:
templates and overloads are hard.  This uses SFINAE to get
the desired behavior, and includes a test.

This also removes a hack in ExceptionWrapper which isn't needed with this fix.

Test Plan: string_test, exception_wrapper_test

Reviewed By: andrei.alexandrescu@fb.com

Subscribers: dreiss, dancol, njormrod

FB internal diff: D1535681

Blame Revision: D1517701
folly/ExceptionWrapper.h
folly/String.h
folly/test/StringTest.cpp