git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix obscure perl message when encryption=tls and smtp cannot connect.
@ 2009-09-25 21:30 iler.ml
  2009-09-25 21:34 ` Shawn O. Pearce
  0 siblings, 1 reply; 3+ messages in thread
From: iler.ml @ 2009-09-25 21:30 UTC (permalink / raw)
  To: git; +Cc: iler.ml

When encryption=tls and smtp cannot connect, git-send-email prints following perl error:

Can't call method "command" on an undefined value at /usr/local/libexec/git-core/git-send-email line 927.

(ithis is when smtp host orport is misspelled, or network is down, and encryption is tls).
We expect some familiar "Cannot connect to SERVER:PORT" message.
Fix it to print normal "smtp can't connect" diagnostics.

--- /usr/local/libexec/git-core/git-send-email.000	2009-09-26 00:10:01.000000000 +0300
+++ /usr/local/libexec/git-core/git-send-email	2009-09-26 00:11:39.000000000 +0300
@@ -922,7 +922,7 @@
 			$smtp ||= Net::SMTP->new((defined $smtp_server_port)
 						 ? "$smtp_server:$smtp_server_port"
 						 : $smtp_server);
-			if ($smtp_encryption eq 'tls') {
+			if ($smtp_encryption eq 'tls' && $smtp) {
 				require Net::SMTP::SSL;
 				$smtp->command('STARTTLS');
 				$smtp->response();

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-25 21:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25 21:30 [PATCH] fix obscure perl message when encryption=tls and smtp cannot connect iler.ml
2009-09-25 21:34 ` Shawn O. Pearce
2009-09-25 21:39   ` Yakov Lerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).