(socketPath string, method string, path string, err error)
| 5576 | } |
| 5577 | |
| 5578 | func newDaemonUnavailableError(socketPath string, method string, path string, err error) error { |
| 5579 | item := diagnosticspkg.NewItem( |
| 5580 | "cli.daemon_unavailable", |
| 5581 | contract.CodeDaemonUnavailable, |
| 5582 | contract.CategoryDaemon, |
| 5583 | "Daemon unavailable", |
| 5584 | fmt.Sprintf("AGH daemon is not reachable at %s while requesting %s %s.", socketPath, method, path), |
| 5585 | contract.SeverityError, |
| 5586 | contract.FreshnessOffline, |
| 5587 | diagnosticspkg.WithSuggestedCommand("agh daemon start"), |
| 5588 | diagnosticspkg.WithEvidence(map[string]any{ |
| 5589 | "socket_path": socketPath, |
| 5590 | "method": method, |
| 5591 | "path": path, |
| 5592 | "cause": err, |
| 5593 | }), |
| 5594 | ) |
| 5595 | return diagnosticspkg.NewStructuredError(item, err) |
| 5596 | } |
| 5597 | |
| 5598 | func isDaemonUnavailableTransportError(err error) bool { |
| 5599 | return errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ECONNREFUSED) |
no outgoing calls
no test coverage detected