1 /*-------------------------------------------------------------------------
6 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
14 * This should eventually work with elog()
16 *-------------------------------------------------------------------------
23 * ExceptionalCondition - Handles the failure of an Assert()
25 * Note: this can't actually return, but we declare it as returning int
26 * because the TrapMacro() macro might get wonky otherwise.
29 ExceptionalCondition(const char *conditionName
,
30 const char *errorType
,
34 if (!PointerIsValid(conditionName
)
35 || !PointerIsValid(fileName
)
36 || !PointerIsValid(errorType
))
37 write_stderr("TRAP: ExceptionalCondition: bad arguments\n");
40 write_stderr("TRAP: %s(\"%s\", File: \"%s\", Line: %d)\n",
41 errorType
, conditionName
,
42 fileName
, lineNumber
);
45 /* Usually this shouldn't be needed, but make sure the msg went out */
48 #ifdef SLEEP_ON_ASSERT
51 * It would be nice to use pg_usleep() here, but only does 2000 sec or 33
52 * minutes, which seems too short.