Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/backend/utils/error/elog.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ ErrorContextCallback *error_context_stack = NULL;

sigjmp_buf *PG_exception_stack = NULL;

/* BEGIN_NEON */
SqlErrorCode_hook_type SqlErrorCode_hook = NULL;
/* END_NEON */

extern bool redirection_done;

/*
Expand Down Expand Up @@ -857,6 +861,11 @@ matches_backtrace_functions(const char *funcname)
int
errcode(int sqlerrcode)
{
/* BEGIN_NEON */
if (SqlErrorCode_hook != NULL) {
SqlErrorCode_hook(sqlerrcode);
}
/* END_NEON */
ErrorData *edata = &errordata[errordata_stack_depth];

/* we don't bother incrementing recursion_depth */
Expand Down
5 changes: 5 additions & 0 deletions src/include/utils/elog.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ extern PGDLLIMPORT ErrorContextCallback *error_context_stack;

extern PGDLLIMPORT sigjmp_buf *PG_exception_stack;

/* BEGIN_HADRON */
typedef void (*SqlErrorCode_hook_type) (int sqlerrcode);
extern PGDLLIMPORT SqlErrorCode_hook_type SqlErrorCode_hook;
/* END_HADRON */


/* Stuff that error handlers might want to use */

Expand Down