From af44670353822cddef7ae647f6f304476e7ae0b9 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Mon, 2 Jan 2017 00:07:23 +0100 Subject: [PATCH] Improve error message for failed domain DNS --- src/Commands/Issue.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Commands/Issue.php b/src/Commands/Issue.php index 86ea143..864fdd2 100644 --- a/src/Commands/Issue.php +++ b/src/Commands/Issue.php @@ -194,7 +194,13 @@ class Issue implements Command { } if (!empty($errors)) { - throw new AcmeException("Couldn't resolve the following domains to an IPv4 nor IPv6 record: " . implode(", ", array_keys($errors))); + $failedDomains = implode(", ", array_keys($errors)); + $reasons = implode("\n\n", array_map(function ($exception) { + /** @var \Exception|\Throwable $exception */ + return get_class($exception) . ": " . $exception->getMessage(); + }, $errors)); + + throw new AcmeException("Couldn't resolve the following domains to an IPv4 nor IPv6 record: {$failedDomains}\n\n{$reasons}"); } }