return;
}
+ my $filename;
my $gobd = SL::GoBD->new(
company => $::instance_conf->get_company,
location => $::instance_conf->get_address,
to => $self->to,
);
- my $filename = $gobd->generate_export;
+ eval {
+ $filename = $gobd->generate_export;
+ } or do {
+ my $errors = $@;
+ flash('error', t8('The export failed because of malformed transactions. Please fix those before exporting.'));
+ flash('error', $_) for @$errors;
+
+ $self->action_filter;
+ return;
+ };
$self->send_file($filename, name => t8('gobd-#1-#2.zip', $self->from->ymd, $self->to->ymd), unlink => 1);
}