TT#40540 Show error about absent binary data method

Change-Id: Ic3cbbca66ca68eb8a1c52aa1c3d8497feaef561a
changes/04/22604/4
Irina Peshinskaya 8 years ago
parent 870056a311
commit 19529cb37b

@ -1469,10 +1469,14 @@ sub return_csv{
sub return_requested_type {
my ($self, $c, $id, $item) = @_;
try{
if (!$self->can('get_item_binary_data')) {
$self->error($c, HTTP_INTERNAL_SERVER_ERROR, "Method not implemented.");
}
my($data_ref,$mime_type,$filename) = $self->get_item_binary_data($c, $id, $item);
$filename //= $self->item_name.''.$self->get_item_id($c, $item);
$mime_type //= 'application/octet-stream' ;
#here we rely on the get_item_binary_data return. If data is empty, it means that get_item_binary_data cared about proper error already
if(!$data_ref){
return;
}

Loading…
Cancel
Save