我们在使用try{}catch(Throwtable e){}时,输出堆栈信息时有符号文件才能知道错误在哪里发生。
新建工程,添加测试代码
import std.stdio;
import std.string;
void test_error()
{
throw new Exception("test");
}
int main(string[] argv)
{
try
{
test_error();
}
catch(Exception e)
{
writeln(e);
}
readln();
return 0;
}

运行:
