use Data::Dumper; my $response; my $ok= eval { $response= $plotly->plot( ... ); 1 }; if( ! $ok ) { warn "Plotly error:"; die Dumper $@; }; ...