Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix exception handling in perl < 5.14

  • Loading branch information...
commit 900c1043b9fc915674315000bec4069f640de637 1 parent 0548366
Gianni Ceccarelli authored
6 lib/Net/Stomp/Producer.pm
View
@@ -219,9 +219,13 @@ sub send {
try { $body = $self->serializer->($body) }
catch {
- local $@=$_;
+ if (eval {$_[0]->isa('Net::Stomp::Producer::Exceptions::CantSerialize')}) {
+ die $_[0];
+ }
+ my $prev=$_[0];
Net::Stomp::Producer::Exceptions::CantSerialize->throw({
message_body => $body,
+ previous_exception => $prev,
});
};
1  lib/Net/Stomp/Producer/Exceptions.pm
View
@@ -69,6 +69,7 @@ use Data::Dump 'pp';
has message_body => ( is => 'ro', required => 1 );
has message_headers => ( is => 'ro', required => 0 );
has reason => ( is => 'ro', default => q{sending the message didn't work} );
+has '+previous_exception' => ( init_arg => 'previous_exception' );
sub as_string {
my ($self) = @_;
Please sign in to comment.
Something went wrong with that request. Please try again.