[libnet-dbus-perl] 225/335: If the message reply is an error, throw a Net::Bus::Error instead of trying to extract return vals

Intrigeri intrigeri at moszumanska.debian.org
Sat Mar 21 01:08:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch experimental
in repository libnet-dbus-perl.

commit 765623c86943dc3908221e6ecc711d0d7b39d203
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Sat Nov 4 16:00:36 2006 -0500

    If the message reply is an error, throw a Net::Bus::Error instead of trying to extract return vals
---
 lib/Net/DBus/ASyncReply.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/Net/DBus/ASyncReply.pm b/lib/Net/DBus/ASyncReply.pm
index 94f6f60..92782b2 100644
--- a/lib/Net/DBus/ASyncReply.pm
+++ b/lib/Net/DBus/ASyncReply.pm
@@ -154,6 +154,13 @@ sub get_result {
 
     my $reply = $self->{pending_call}->get_reply;
 
+    if ($reply->isa("Net::DBus::Binding::Message::Error")) {
+	my $iter = $reply->iterator();
+	my $desc = $iter->get_string();
+	die Net::DBus::Error->new(name => $reply->get_error_name,
+				  message => $desc);
+    }
+
     my @reply;
     if ($self->{introspector}) {
 	@reply = $self->{introspector}->decode($reply, "methods", $self->{method_name}, "returns");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git



More information about the Pkg-perl-cvs-commits mailing list