T1c verb-timeout-console: mesh_call waits the timeout its verb's definition names and says it
The console's surface holds the runner's seat definitions; a seat verb's call waits its `timeout`, and a timeout's text names the bound waited, not a fixed 30s. Builds: design 47 H §760, H-A-43 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
|
||||
@@ -120,6 +121,11 @@ var (
|
||||
|
||||
// whyItFailed says why a call failed, so the remedy is in the words.
|
||||
func whyItFailed(key string, err error) string {
|
||||
return whyItFailedWithin(key, err, bus.RequestTimeout)
|
||||
}
|
||||
|
||||
// whyItFailedWithin is whyItFailed for a call that waited within, the bound its verb's definition names or the runner's own.
|
||||
func whyItFailedWithin(key string, err error, within time.Duration) string {
|
||||
if err == nil {
|
||||
err = errors.New("failed")
|
||||
}
|
||||
@@ -139,7 +145,7 @@ func whyItFailed(key string, err error) string {
|
||||
case timedOut.MatchString(msg):
|
||||
// **A timeout is not a failure** (novox/hq issue 265). Something took the call, so it may
|
||||
// still be running and may already have done what was asked: a push said this while it pushed.
|
||||
said := key + " did not answer within " + bus.RequestTimeout.String() + ". That is not a failure: " +
|
||||
said := key + " did not answer within " + within.String() + ". That is not a failure: " +
|
||||
"something is serving it, so it may still be running and may already have done what was " +
|
||||
"asked — check before repeating a call that changes the mesh."
|
||||
return said
|
||||
|
||||
Reference in New Issue
Block a user