guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 78d6e1e54b1c433ca55c92c9c93c685819fc6eb2
Author: Ludovic Courtès <[email protected]>
AuthorDate: Mon Jul 6 23:44:31 2026 +0200
ftp-client: ‘connect*’ includes IP address in error message.
This adds the IP address to error messages coming from ‘connect*’ such as
those shown by ‘guix weather’.
* guix/ftp-client.scm (connect*)[raise-error]: Add info about ‘sockaddr’ in
message.
Signed-off-by: Ludovic Courtès <[email protected]>
Merges: #9770
---
guix/ftp-client.scm | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/guix/ftp-client.scm b/guix/ftp-client.scm
index 73f5040f04..24b18a8033 100644
--- a/guix/ftp-client.scm
+++ b/guix/ftp-client.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2010-2017, 2019, 2023 Ludovic Courtès <[email protected]>
+;;; Copyright © 2010-2017, 2019, 2023, 2026 Ludovic Courtès <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -96,8 +96,14 @@
When TIMEOUT is a number, it is the (possibly inexact) maximum number of
seconds to wait for the connection to succeed."
(define (raise-error errno)
- (throw 'system-error 'connect* "~A"
- (list (strerror errno))
+ (throw 'system-error 'connect* "~A: ~A"
+ (list (cond ((= AF_INET (sockaddr:fam sockaddr))
+ (inet-ntop AF_INET (sockaddr:addr sockaddr)))
+ ((= AF_INET6 (sockaddr:fam sockaddr))
+ (inet-ntop AF_INET6 (sockaddr:addr sockaddr)))
+ (else
+ (object->string sockaddr)))
+ (strerror errno))
(list errno)))
(if timeout