Skip to content

Commit

Permalink
add diagnostics on JSON failures
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Mar 1, 2010
1 parent 98460b0 commit a84814b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Metabase/Report.pm
Expand Up @@ -124,7 +124,9 @@ sub content_as_bytes {
Carp::confess("can't serialize an open report") unless $self->{__closed};

my $content = [ map { $_->as_struct } @{ $self->content } ];
JSON->new->encode( $content );
my $encoded = eval { JSON->new->encode( $content ) };
Carp::confess $@ if $@;
return $encoded;
}

sub content_from_bytes {
Expand Down

0 comments on commit a84814b

Please sign in to comment.