X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FProxy.pm;h=18e8436ddb966cc77d674cdc6759d937d68a72e3;hb=de9062cfef7f98d0efc01b114328959f2f84ada4;hp=3c46eeb704a3ae16dfb885d2e1d2e1ed57c116dc;hpb=3f1f1e662b0737ba6225973b88f2d78dd2344314;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/Proxy.pm b/lib/Object/Remote/Proxy.pm index 3c46eeb..18e8436 100644 --- a/lib/Object/Remote/Proxy.pm +++ b/lib/Object/Remote/Proxy.pm @@ -1,6 +1,7 @@ package Object::Remote::Proxy; use strictures 1; +use Carp qw(croak); sub AUTOLOAD { my $self = shift; @@ -9,6 +10,11 @@ sub AUTOLOAD { if ((caller(0)||'') eq 'start') { $to_fire = "start::${to_fire}"; } + + unless ($self->{remote}->is_valid) { + croak "Attempt to use Object::Remote::Proxy backed by an invalid handle"; + } + $self->{remote}->$to_fire($method => @_); }