diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-08-10 20:29:18 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-08-10 20:29:18 +0000 |
commit | c5354dff2052e6922ae7add998753d9bafcd19b0 (patch) | |
tree | 59fea2bf500334eeb549109193b20ffbe2580430 /src/backend/utils/error/assert.c | |
parent | 8be9bd83acd43762cf0dc8a45229a693896e7755 (diff) |
This patch removes a lot of unused code related to assertions and
error handling, and simplifies the code that remains. Apparently,
the code that left Berkeley had a whole "error handling subsystem",
which exceptions and whatnot. Since we don't use that anymore,
there's no reason to keep it around.
The regression tests pass with the patch applied. Unless anyone
sees a problem, please apply.
Neil Conway
Diffstat (limited to 'src/backend/utils/error/assert.c')
-rw-r--r-- | src/backend/utils/error/assert.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/src/backend/utils/error/assert.c b/src/backend/utils/error/assert.c index eee458020df..81fe83c4b47 100644 --- a/src/backend/utils/error/assert.c +++ b/src/backend/utils/error/assert.c @@ -8,65 +8,44 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.21 2002/06/20 20:29:39 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.22 2002/08/10 20:29:18 momjian Exp $ * * NOTE - * This should eventually work with elog(), dlog(), etc. + * This should eventually work with elog() * *------------------------------------------------------------------------- */ #include "postgres.h" -#include <stdio.h> #include <unistd.h> -#include "utils/exc.h" - +/* + * ExceptionalCondition - Handles the failure of an Assert() + */ int ExceptionalCondition(char *conditionName, - Exception *exceptionP, - char *detail, + char *errorType, char *fileName, int lineNumber) { - ExcFileName = fileName; - ExcLineNumber = lineNumber; - if (!PointerIsValid(conditionName) || !PointerIsValid(fileName) - || !PointerIsValid(exceptionP)) + || !PointerIsValid(errorType)) { fprintf(stderr, "TRAP: ExceptionalCondition: bad arguments\n"); - - ExcAbort(exceptionP, - (ExcDetail) detail, - (ExcData) NULL, - (ExcMessage) NULL); } else { - fprintf(stderr, "TRAP: %s(\"%s:%s\", File: \"%s\", Line: %d)\n", - exceptionP->message, conditionName, - (detail == NULL ? "" : detail), + fprintf(stderr, "TRAP: %s(\"%s\", File: \"%s\", Line: %d)\n", + errorType, conditionName, fileName, lineNumber); } -#ifdef ABORT_ON_ASSERT - abort(); -#endif #ifdef SLEEP_ON_ASSERT sleep(1000000); #endif - /* - * XXX Depending on the Exception and tracing conditions, you will XXX - * want to stop here immediately and maybe dump core. XXX This may be - * especially true for Assert(), etc. - */ - - /* TraceDump(); dump the trace stack */ + abort(); - /* XXX FIXME: detail is lost */ - ExcRaise(exceptionP, (ExcDetail) 0, (ExcData) NULL, conditionName); return 0; } |