Subject: Re: bug#47439: 27.2; In daemon mode, if after-init-hook errors out, the server does not start

From: Eli Zaretskii <[email-masked]>
Date: Sun, 28 Mar 2021 17:05:12 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Sun, 28 Mar 2021 15:56:01 +0200
> Cc: [email-masked]
> 
> There is no `condition-case' around the running of this hook;
> therefore, if `debug-on-error' is non-nil, an error in one of
> these functions will invoke the debugger.
> ---
> 
> So I think this is expected behaviour?  Anybody got an opinion?

The problem here is that if the daemon signals an error any place
during startup before it starts the server, there's no way at all to
communicate with the daemon, so you cannot know what happened and why.

So I think we should provide one of the following, in case of such
errors:

 . exit the daemon and leave the description of the problem on some
   disk file, or display it on the screen
 . start the server and allow clients to connect and see the error
   message, with or without the backtrace