Commit 33297f59 authored by Nigel McNie's avatar Nigel McNie
Browse files

Handle errors from curl much more gracefully when attempting to grab RSS feeds.

Prevents a horrible crash at import time.
Signed-off-by: default avatarNigel McNie <>
parent fcbb2177
......@@ -273,11 +273,8 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
$result = mahara_http_request($config);
if($result->data) {
if ($result->error) {
$cache[$source] = $result->error;
throw $cache[$source];
throw new XML_Feed_Parser_Exception($result->error);
try {
......@@ -398,8 +395,14 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
// RSS feeds for this user at import time, which could easily be quite
// slow. This plugin will need a bit of re-working for this to be possible
if (!empty($config['config']['url'])) {
try {
$values = self::instance_config_save(array('url' => $config['config']['url']));
catch (XML_Feed_Parser_Exception $e) {
log_info("Note: was unable to parse RSS feed for new blockinstance. URL was {$config['config']['url']}");
$values = array();
$bi = new BlockInstance(0,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment