Function: server-return-error

server-return-error is a byte-compiled function defined in server.el.gz.

Signature

(server-return-error PROC ERR)

Source Code

;; Defined in /usr/src/emacs/lisp/server.el.gz
(defun server-return-error (proc err)
  (ignore-errors
    ;; Display the error as a message and give the user time to see
    ;; it, in case the error written by emacsclient to stderr is not
    ;; visible for some reason.
    (server--message-sit-for 2 (error-message-string err))
    (server-send-string
     proc (concat "-error " (server-quote-arg
                             (error-message-string err))))
    (server-log (error-message-string err) proc)
    (unless (eq system-type 'windows-nt)
      (let ((terminal (process-get proc 'terminal)))
        ;; Only delete the terminal if it is non-nil.
        (when (and terminal (eq (terminal-live-p terminal) t))
	  (delete-terminal terminal))))
    ;; Before calling `delete-process', give emacsclient time to
    ;; receive the error string and shut down on its own.
    ;; FIXME: Why do we wait 5s here but 1s in the other one?
    (run-with-timer 5 nil #'delete-process proc)))