3

There are several components to error/notice creation and display process:
add_settings_error() call to add item to stack (global $wp_settings_errors variable).
settings_errors transient that keeps the errors so they survive move from page to page.
settings_errors() function get_settings_errors...