File tree Expand file tree Collapse file tree 1 file changed +26
-19
lines changed Expand file tree Collapse file tree 1 file changed +26
-19
lines changed Original file line number Diff line number Diff line change 3
3
#include < exception>
4
4
#include < string>
5
5
6
+ #include < parquet/exception.h>
7
+
6
8
struct ExceptionInfo final
7
9
{
8
10
ExceptionInfo (const char * type, const char * message);
@@ -14,23 +16,28 @@ struct ExceptionInfo final
14
16
};
15
17
16
18
#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
+ } \
36
43
You can’t perform that action at this time.
0 commit comments