Cleanup the code and unified everything (except the macros) under the akerr_ namespace
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
#include "akerror.h"
|
||||
|
||||
ErrorContext *func2(void)
|
||||
akerr_ErrorContext *func2(void)
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
ATTEMPT {
|
||||
FAIL(errctx, ERR_NULLPOINTER, "This is a failure in func2");
|
||||
FAIL(errctx, AKERR_NULLPOINTER, "This is a failure in func2");
|
||||
} CLEANUP {
|
||||
} PROCESS(errctx) {
|
||||
} FINISH(errctx, true);
|
||||
SUCCEED_RETURN(errctx);
|
||||
}
|
||||
|
||||
ErrorContext *func1(void)
|
||||
akerr_ErrorContext *func1(void)
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
ATTEMPT {
|
||||
@@ -30,7 +30,7 @@ int main(void)
|
||||
CATCH(errctx, func1());
|
||||
} CLEANUP {
|
||||
} PROCESS(errctx) {
|
||||
} HANDLE(errctx, ERR_NULLPOINTER) {
|
||||
error_log_method("Caught exception");
|
||||
} HANDLE(errctx, AKERR_NULLPOINTER) {
|
||||
akerr_log_method("Caught exception");
|
||||
} FINISH_NORETURN(errctx);
|
||||
}
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
|
||||
int x;
|
||||
|
||||
ErrorContext *func2(void)
|
||||
akerr_ErrorContext *func2(void)
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
ATTEMPT {
|
||||
FAIL(errctx, ERR_NULLPOINTER, "This is a failure in func2");
|
||||
FAIL(errctx, AKERR_NULLPOINTER, "This is a failure in func2");
|
||||
} CLEANUP {
|
||||
} PROCESS(errctx) {
|
||||
} FINISH(errctx, true);
|
||||
SUCCEED_RETURN(errctx);
|
||||
}
|
||||
|
||||
ErrorContext *func1(void)
|
||||
akerr_ErrorContext *func1(void)
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
ATTEMPT {
|
||||
@@ -33,7 +33,7 @@ int main(void)
|
||||
CATCH(errctx, func1());
|
||||
} CLEANUP {
|
||||
} PROCESS(errctx) {
|
||||
} HANDLE(errctx, ERR_NULLPOINTER) {
|
||||
} HANDLE(errctx, AKERR_NULLPOINTER) {
|
||||
if ( x == 0 ) {
|
||||
fprintf(stderr, "Cleanup works\n");
|
||||
return 0;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
#include "akerror.h"
|
||||
|
||||
ErrorContext *func2(void)
|
||||
akerr_ErrorContext *func2(void)
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
ATTEMPT {
|
||||
FAIL(errctx, ERR_NULLPOINTER, "This is a failure in func2");
|
||||
FAIL(errctx, AKERR_NULLPOINTER, "This is a failure in func2");
|
||||
} CLEANUP {
|
||||
} PROCESS(errctx) {
|
||||
} FINISH(errctx, true);
|
||||
SUCCEED_RETURN(errctx);
|
||||
}
|
||||
|
||||
ErrorContext *func1(void)
|
||||
akerr_ErrorContext *func1(void)
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
ATTEMPT {
|
||||
|
||||
Reference in New Issue
Block a user