File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33#include < exception>
44#include < string>
55
6+ #include < parquet/exception.h>
7+
68struct ExceptionInfo final
79{
810 ExceptionInfo (const char * type, const char * message);
@@ -14,23 +16,28 @@ struct ExceptionInfo final
1416};
1517
1618#define SINGLE_ARG (...) __VA_ARGS__
17- #define TRYCATCH (expression ) \
18- try \
19- { \
20- expression \
21- return nullptr ; \
22- } \
23- catch (const std::bad_alloc& exception) \
24- { \
25- return new ExceptionInfo (" OutOfMemoryException" , exception.what ()); \
26- } \
27- catch (const std::exception& exception) \
28- { \
29- return new ExceptionInfo (exception); \
30- } \
31- catch (...) \
32- { \
33- return new ExceptionInfo (" unkown" , " uncaught exception" ); \
34- } \
35-
19+ #define TRYCATCH (expression ) \
20+ try \
21+ { \
22+ expression \
23+ return nullptr ; \
24+ } \
25+ catch (const std::bad_alloc& exception) \
26+ { \
27+ return new ExceptionInfo (" OutOfMemoryException" , exception.what ()); \
28+ } \
29+ catch (const parquet::ParquetStatusException& exception) \
30+ { \
31+ return exception.status ().IsOutOfMemory () \
32+ ? new ExceptionInfo (" OutOfMemoryException" , exception.what ()) \
33+ : new ExceptionInfo (exception); \
34+ } \
35+ catch (const std::exception& exception) \
36+ { \
37+ return new ExceptionInfo (exception); \
38+ } \
39+ catch (...) \
40+ { \
41+ return new ExceptionInfo (" unknown" , " uncaught exception" ); \
42+ } \
3643
You can’t perform that action at this time.
0 commit comments