[Debconf-devel] Bug#657626: [PATCH] make sure that error messages are also debug-printed.

Matthijs Kooijman matthijs at stdin.nl
Fri Jan 27 15:09:11 UTC 2012


Before, unknown commands or invalid commandlines could cause an error to
be sent to the confmodule, but not printed with DEBCONF_DEBUG=developer,
making debugging such an error hard.
---
 Debconf/ConfModule.pm |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Debconf/ConfModule.pm b/Debconf/ConfModule.pm
index b3989a6..61f8b98 100644
--- a/Debconf/ConfModule.pm
+++ b/Debconf/ConfModule.pm
@@ -236,8 +236,10 @@ sub process_command {
 		($command, @params)=split(' ', $_);
 	}
 	if (! defined $command) {
-		return $codes{syntaxerror}.' '.
+		my $ret = $codes{syntaxerror}.' '.
 			"Bad line \"$_\" received from confmodule.";
+		debug developer => "--> $ret";
+		return $ret;
 	}
 	$command=lc($command);
 	# This command could not be handled by a sub.
@@ -246,8 +248,10 @@ sub process_command {
 	}
 	# Make sure that the command is valid.
 	if (! $this->can("command_$command")) {
-		return $codes{syntaxerror}.' '.
+		my $ret = $codes{syntaxerror}.' '.
 		       "Unsupported command \"$command\" (full line was \"$_\") received from confmodule.";
+		debug developer => "--> $ret";
+		return $ret;
 	}
 	# Now call the subroutine for the command.
 	$command="command_$command";
-- 
1.7.7.3






More information about the Debconf-devel mailing list