Variable: command-error-function

If non-nil, function to output error messages.
The arguments are the error data, a list of the form
such as just as `condition-case' would bind its variable to,
the context (a string which normally goes at the start of the message),
and the Lisp function within which the error was signaled.