1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Add braces and spaces for clarity.

This should make it a little easier to see how the TRY macros work together.
This commit is contained in:
David Steele 2020-01-16 16:23:40 -07:00
parent 254f79803f
commit d3be1e41a4

View File

@ -84,37 +84,39 @@ unsigned int errorTryDepth(void);
Begin a block where errors can be thrown
***********************************************************************************************************************************/
#define TRY_BEGIN() \
do \
{ \
if (errorInternalTry(__FILE__, __func__, __LINE__) && setjmp(*errorInternalJump()) >= 0) \
do \
{ \
while (errorInternalProcess(false)) \
if (errorInternalStateTry())
if (errorInternalTry(__FILE__, __func__, __LINE__) && setjmp(*errorInternalJump()) >= 0) \
{ \
while (errorInternalProcess(false)) \
{ \
if (errorInternalStateTry())
/***********************************************************************************************************************************
Catch a specific error thrown in the try block
***********************************************************************************************************************************/
#define CATCH(errorTypeCatch) \
else if (errorInternalStateCatch(&errorTypeCatch))
else if (errorInternalStateCatch(&errorTypeCatch))
/***********************************************************************************************************************************
Catch any error thrown in the try block
***********************************************************************************************************************************/
#define CATCH_ANY() \
else if (errorInternalStateCatch(&RuntimeError))
else if (errorInternalStateCatch(&RuntimeError))
/***********************************************************************************************************************************
Code to run whether the try block was successful or not
***********************************************************************************************************************************/
#define FINALLY() \
else if (errorInternalStateFinal())
else if (errorInternalStateFinal())
/***********************************************************************************************************************************
End the try block
***********************************************************************************************************************************/
#define TRY_END() \
} \
} while (0)
} \
} \
} while (0)
/***********************************************************************************************************************************
Throw an error