add try catch
This commit is contained in:
parent
0352e3db82
commit
176a863455
1 changed files with 4 additions and 0 deletions
|
@ -28,6 +28,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
int main()
|
int main()
|
||||||
|
try
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Sample s;
|
Sample s;
|
||||||
|
@ -39,4 +40,7 @@ int main()
|
||||||
}
|
}
|
||||||
ErrorSample es;
|
ErrorSample es;
|
||||||
es.gen();
|
es.gen();
|
||||||
|
} catch (std::exception& e) {
|
||||||
|
printf("err %s\n", e.what());
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue