summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mappers/file.inc8
-rw-r--r--plugins/FeedsParser.inc7
2 files changed, 13 insertions, 2 deletions
diff --git a/mappers/file.inc b/mappers/file.inc
index ce777ad..2cc5dc3 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 7d1004f..5cdac88 100644
--- a/plugins/FeedsParser.inc
+++ b/plugins/FeedsParser.inc
@@ -368,7 +368,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.