
key:fillStackTrace():将调用的栈信息存储下来demangle():将函数名转换
#include"Exception.h"#include <stdio.h>class Bar{public:void test(){throw tinymuduo::Exception("oops");}};void foo(){Bar b;b.test();}int main(){try{foo();}catch (const tinymuduo::Exception& ex){printf("reason: %s\n", ex.what());//错误信息printf("stack trace: %s\n", ex.stackTrace());//堆栈调用情况}}
