summaryrefslogtreecommitdiff
path: root/examples/c/ex_event_handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/c/ex_event_handler.c')
-rw-r--r--examples/c/ex_event_handler.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/c/ex_event_handler.c b/examples/c/ex_event_handler.c
index 03809cae7c8..acd9d9beecc 100644
--- a/examples/c/ex_event_handler.c
+++ b/examples/c/ex_event_handler.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2016 MongoDB, Inc.
+ * Public Domain 2014-2017 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -70,6 +70,10 @@ handle_wiredtiger_error(WT_EVENT_HANDLER *handler,
"app_id %s, thread context %p, error %d, message %s\n",
custom_handler->app_id, (void *)session, error, message);
+ /* Exit if the database has a fatal error. */
+ if (error == WT_PANIC)
+ exit (1);
+
return (0);
}