Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
main_exception_catcher.cpp
Go to the documentation of this file.
2
3#include <iostream>
4
5namespace joedb
6{
7 /// Catch exception from main
8 ///
9 /// This function is particularly necessary in Windows, because no
10 /// exception information is printed by default there.
12 (
13 int (*main)(int, char**), int argc, char **argv
14 )
15 {
16 try
17 {
18 return main(argc, argv);
19 }
20 catch (const std::exception &e)
21 {
22 std::cerr << "Exception caught: " << e.what() << '\n';
23 return 1;
24 }
25 }
26}
int main()
int main_exception_catcher(int(*main)(int, char **), int argc, char **argv)
Catch exception from main.
Definition Blob.h:7