projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
708be4f
)
Helper method to get exception type
author
Hitesh Khandelwal
<hitesh@fb.com>
Fri, 20 Dec 2013 19:02:23 +0000
(11:02 -0800)
committer
Jordan DeLong
<jdelong@fb.com>
Fri, 20 Dec 2013 21:08:19 +0000
(13:08 -0800)
Test Plan: Tested with subsequent thrift diff
Reviewed By: davejwatson@fb.com
FB internal diff:
D1108428
folly/String.h
patch
|
blob
|
history
diff --git
a/folly/String.h
b/folly/String.h
index da93cd265d106a296e60a651aad59cd1cfb16bfd..e0790f54e24a1ff3de452e130b6b9434e5c6ba09 100644
(file)
--- 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<fbstring>(demangle(typeid(e)));
+}
+
/**
* Debug string for an exception: include type and what().
*/