function getProfile()
{
- return Profile::staticGet('id', $this->profile_id);
+ $profile = Profile::staticGet('id', $this->profile_id);
+
+ if (empty($profile)) {
+ throw new ServerException(sprintf(_('No such profile (%d) for notice (%d)'), $this->profile_id, $this->id));
+ }
+
+ return $profile;
}
function delete()
{
$profile = $notice->getProfile();
- if (empty($profile)) {
- throw new ServerException(sprintf(_('No such profile: %d'), $notice->profile_id));
- }
-
$entry = array();
// We trim() to avoid extraneous whitespace in the output
$entry = $this->twitterRssEntryArray($n);
$this->showTwitterRssItem($entry);
} catch (Exception $e) {
- common_log(LOG_ERR, "Error with notice {$n->id}: " . $e->getMessage());
+ common_log(LOG_ERR, $e->getMessage());
// continue on exceptions
}
}
$entry = $this->twitterRssEntryArray($notice);
$this->showTwitterRssItem($entry);
} catch (Exception $e) {
- common_log(LOG_ERR, "Error with notice {$n->id}: " . $e->getMessage());
+ common_log(LOG_ERR, $e->getMessage());
// continue on exceptions
}
}