From: Hitesh Khandelwal Date: Fri, 20 Dec 2013 19:02:23 +0000 (-0800) Subject: Helper method to get exception type X-Git-Tag: v0.22.0~749 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=799322db5c1274cd7180e5cc5a5d992bd0388165;p=folly.git Helper method to get exception type Test Plan: Tested with subsequent thrift diff Reviewed By: davejwatson@fb.com FB internal diff: D1108428 --- diff --git a/folly/String.h b/folly/String.h index da93cd26..e0790f54 100644 --- a/folly/String.h +++ b/folly/String.h @@ -352,6 +352,13 @@ inline size_t demangle(const std::type_info& type, char* buf, size_t bufSize) { return demangle(type.name(), buf, bufSize); } +/** + * Debug string for an exception: include type only. + */ +inline fbstring exceptionTypeStr(const std::exception& e) { + return folly::to(demangle(typeid(e))); +} + /** * Debug string for an exception: include type and what(). */