diff --git a/mappers/file.inc b/mappers/file.inc index 63c1e2d..3eb9fda 100644 --- a/mappers/file.inc +++ b/mappers/file.inc @@ -75,7 +75,13 @@ function file_feeds_set_target($source, $entity, $target, $value) { $i = 0; $field = isset($entity->$target) ? $entity->$target : array(); foreach ($value as $v) { - if ($file = $v->getFile($destination)) { + try { + $file = $v->getFile($destination); + } + catch (Exception $e) { + watchdog_exception('Feeds', $e, nl2br(check_plain($e))); + } + if ($file) { $field['und'][$i] = (array)$file; $field['und'][$i]['display'] = 1; // @todo: Figure out how to properly populate this field. if ($info['cardinality'] == 1) { diff --git a/plugins/FeedsParser.inc b/plugins/FeedsParser.inc index 31b78c0..a5f2e58 100644 --- a/plugins/FeedsParser.inc +++ b/plugins/FeedsParser.inc @@ -352,7 +352,12 @@ class FeedsEnclosure extends FeedsElement { if (file_uri_target($destination)) { $destination = trim($destination, '/') . '/'; } - $file = file_save_data($this->getContent(), $destination . $filename); + try { + $file = file_save_data($this->getContent(), $destination . $filename); + } + catch (Exception $e) { + watchdog_exception('Feeds', $e, nl2br(check_plain($e))); + } } // We couldn't make sense of this enclosure, throw an exception.