Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
5bd589bc
Commit
5bd589bc
authored
15 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
Handle exceptions outside of Importer/Source facade methods.
parent
a8b6bb31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/FeedsImporter.inc
+7
-7
7 additions, 7 deletions
includes/FeedsImporter.inc
includes/FeedsScheduler.inc
+1
-0
1 addition, 0 deletions
includes/FeedsScheduler.inc
includes/FeedsSource.inc
+9
-6
9 additions, 6 deletions
includes/FeedsSource.inc
with
17 additions
and
13 deletions
includes/FeedsImporter.inc
+
7
−
7
View file @
5bd589bc
...
...
@@ -73,15 +73,12 @@ class FeedsImporter extends FeedsConfigurable {
* @return
* FEEDS_BATCH_COMPLETE if complete, a float between 0 and 1 indicating
* progress otherwise.
*
* @throws
* Throws Exception if an error occurs when expiring items.
*/
public
function
expire
(
$time
=
NULL
)
{
try
{
return
$this
->
processor
->
expire
(
$time
);
}
catch
(
Exception
$e
)
{
drupal_set_message
(
$e
->
getMessage
(),
'error'
);
return
FEEDS_BATCH_COMPLETE
;
}
return
$this
->
processor
->
expire
(
$time
);
}
/**
...
...
@@ -96,6 +93,9 @@ class FeedsImporter extends FeedsConfigurable {
* @return
* FEEDS_BATCH_COMPLETE if complete, a float between 0 and 1 indicating
* progress otherwise.
*
* @throws
* Throws Exception if an error occurs working off the job.
*/
public
function
work
(
$job
)
{
if
(
$this
->
export_type
==
FEEDS_EXPORT_NONE
)
{
...
...
This diff is collapsed.
Click to expand it.
includes/FeedsScheduler.inc
+
1
−
0
View file @
5bd589bc
...
...
@@ -165,6 +165,7 @@ class FeedsScheduler implements FeedsSchedulerInterface {
}
catch
(
Exception
$e
)
{
watchdog
(
'FeedsScheduler'
,
$e
->
getMessage
(),
array
(),
WATCHDOG_ERROR
);
$this
->
finished
(
$job
);
}
// Make sure that job is not scheduled after this method has executed.
$this
->
unschedule
(
$job
);
...
...
This diff is collapsed.
Click to expand it.
includes/FeedsSource.inc
+
9
−
6
View file @
5bd589bc
...
...
@@ -108,8 +108,8 @@ class FeedsSource extends FeedsConfigurable {
* Lock a source before importing by using FeedsSource::lock(), after
* importing, release with FeedsSource::release().
*
* @t
odo Iron out and document potential Exceptions.
*
@todo catch exceptions outside of import(), clear() and expire()
.
* @t
hrows
*
Throws Exception if an error occurs when importing
.
*/
public
function
import
()
{
try
{
...
...
@@ -125,8 +125,8 @@ class FeedsSource extends FeedsConfigurable {
}
catch
(
Exception
$e
)
{
unset
(
$this
->
batch
);
$
result
=
FEEDS_BATCH_ACTIVE
;
drupal_set_message
(
$e
->
getMessage
(),
'error'
)
;
$
this
->
save
()
;
throw
$e
;
}
$this
->
save
();
return
$result
;
...
...
@@ -134,6 +134,9 @@ class FeedsSource extends FeedsConfigurable {
/**
* Remove all items from a feed.
*
* @throws
* Throws Exception if an error occurs when clearing.
*/
public
function
clear
()
{
try
{
...
...
@@ -149,8 +152,8 @@ class FeedsSource extends FeedsConfigurable {
}
catch
(
Exception
$e
)
{
unset
(
$this
->
batch
);
$
result
=
FEEDS_BATCH_COMPLETE
;
drupal_set_message
(
$e
->
getMessage
(),
'error'
)
;
$
this
->
save
()
;
throw
$e
;
}
$this
->
save
();
return
$result
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment