Commit 799322db authored by Hitesh Khandelwal's avatar Hitesh Khandelwal Committed by Jordan DeLong

Helper method to get exception type

Test Plan: Tested with subsequent thrift diff

Reviewed By: davejwatson@fb.com

FB internal diff: D1108428
parent 708be4fc
...@@ -352,6 +352,13 @@ inline size_t demangle(const std::type_info& type, char* buf, size_t bufSize) { ...@@ -352,6 +352,13 @@ inline size_t demangle(const std::type_info& type, char* buf, size_t bufSize) {
return demangle(type.name(), buf, 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<fbstring>(demangle(typeid(e)));
}
/** /**
* Debug string for an exception: include type and what(). * Debug string for an exception: include type and what().
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment