1 /*-------------------------------------------------------------------------
6 * Copyright (c) 1994, Regents of the University of California
10 * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.4 1997/04/17 20:38:26 scrappy Exp $
13 * This should eventually work with elog(), dlog(), etc.
15 *-------------------------------------------------------------------------
19 #include "postgres.h" /* where the declaration goes */
20 #include "utils/module.h"
22 #include "utils/exc.h"
25 ExceptionalCondition(char* conditionName,
26 Exception *exceptionP,
31 extern char* ExcFileName; /* XXX */
32 extern Index ExcLineNumber; /* XXX */
34 ExcFileName = fileName;
35 ExcLineNumber = lineNumber;
37 if (!PointerIsValid(conditionName)
38 || !PointerIsValid(fileName)
39 || !PointerIsValid(exceptionP)) {
40 fprintf(stderr, "ExceptionalCondition: bad arguments\n");
48 "%s(\"%s:%s\", File: \"%s\", Line: %d)\n",
49 exceptionP->message, conditionName, detail == NULL ? "" : detail,
50 fileName, lineNumber);
53 #ifdef ABORT_ON_ASSERT
57 * XXX Depending on the Exception and tracing conditions, you will
58 * XXX want to stop here immediately and maybe dump core.
59 * XXX This may be especially true for Assert(), etc.
62 /* TraceDump(); dump the trace stack */
64 /* XXX FIXME: detail is lost */
65 ExcRaise(exceptionP, (ExcDetail)0, (ExcData)NULL, conditionName);