Browse Source

Fixed datastream error handling

pull/120/head
jonathangreen 13 years ago
parent
commit
b600074575
  1. 7
      includes/datastream.inc

7
includes/datastream.inc

@ -19,10 +19,6 @@ function islandora_datastream_as_attachment($object_id, $dsid) {
try {
$restConnection = new RestConnection($user);
$fedora_object = new FedoraObject($object_id, $restConnection->repository);
} catch (Exception $e) {
drupal_set_message(t('Error getting Islanndora datastream $d for object %s', array('%s' => $object_id, '%d' => $dsid)), 'error');
return"";
}
header('Content-type: ' . $fedora_object[$dsid]->mimetype);
if($fedora_object[$dsid]->controlGroup == 'M' || $fedora_object[$dsid]->controlGroup == 'X') {
header('Content-length: ' . $fedora_object[$dsid]->size);
@ -34,6 +30,9 @@ function islandora_datastream_as_attachment($object_id, $dsid) {
}
print($fedora_object[$dsid]->content);
exit();
} catch (Exception $e) {
return drupal_not_found();;
}
}
function islandora_get_datastream_parents($islandora_object) {

Loading…
Cancel
Save