[an error occurred while processing this directive]
$Epilog is a symbol whose value, if any, is evaluated when a dialog or a Mathematica session is terminated.
For Mathematica sessions, $Epilog is conventionally defined to read in a file named end.m.
See the Mathematica book: Section 2.13.1.
See also: Exit, Quit, Dialog.