Answer a panicking verb with an error, say flag errors in the answer, and leave refused logins out of D15

Read verbs now run in the serving process, where a panic would end every
call; refused logins are nobody's reconnect loop (review of hq issue 327).
This commit is contained in:
jochen
2026-10-08 21:08:34 +02:00
parent 1e04670052
commit cc7fb99f29
9 changed files with 110 additions and 33 deletions
+11
View File
@@ -1,7 +1,10 @@
package main
import (
"flag"
"fmt"
"io"
"os"
"sync/atomic"
"github.com/novox/mesh-controller/internal/broker"
@@ -36,3 +39,11 @@ func aBus() (*broker.JetStream, error) {
}
return js, nil
}
// usageTo sends a command's flag errors and usage to where its answer goes when that is not this process's
// output: a verb answered in the serving controller says them in its answer, not in the controller's log.
func usageTo(set *flag.FlagSet, w io.Writer) {
if w != os.Stdout {
set.SetOutput(w)
}
}