Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
84b3188c
Commit
84b3188c
authored
Aug 15, 2017
by
Matthieu Muffato
Browse files
Tried extending the interface of throw()
parent
a142aebb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
modules/Bio/EnsEMBL/Hive/Examples/LongMult/RunnableDB/DigitFactory.pm
...EnsEMBL/Hive/Examples/LongMult/RunnableDB/DigitFactory.pm
+4
-0
modules/Bio/EnsEMBL/Hive/Process.pm
modules/Bio/EnsEMBL/Hive/Process.pm
+19
-1
No files found.
modules/Bio/EnsEMBL/Hive/Examples/LongMult/RunnableDB/DigitFactory.pm
View file @
84b3188c
...
...
@@ -124,6 +124,10 @@ sub write_output { # nothing to write out, but some dataflow to perform:
$self
->
warning
('
Attempted to create
'
.
scalar
(
@$sub_tasks
)
.
"
multiplication jobs
");
# warning messages get recorded into 'log_message' table
$self
->
throw
('
end
',
'
analysis
');
#$self->attempt->lethality_level('beekeeper');
#$self->attempt->lethality_level('worker');
## extra information sent to the funnel will extend its stack:
# $self->dataflow_output_id( { 'different_digits' => scalar(@$sub_tasks) } , 1);
}
...
...
modules/Bio/EnsEMBL/Hive/Process.pm
View file @
84b3188c
...
...
@@ -563,8 +563,26 @@ sub dataflow_output_id {
}
my
%allowed_failure_levels
=
map
{
$_
=>
1
}
qw(attempt job analysis)
;
my
%allowed_lethality_levels
=
map
{
$_
=>
1
}
qw(role worker beekeeper)
;
sub
throw
{
my
$msg
=
pop
@_
;
my
(
$self
,
$msg
,
$failure_level
,
$lethality_level
)
=
@_
;
if
((
defined
$lethality_level
)
&&
!
$allowed_lethality_levels
{
$lethality_level
})
{
$msg
=
"
Unrecognized
\$
lethality_level '
$lethality_level
' whilst throwing:
\n
$msg
";
}
elsif
(
$lethality_level
)
{
$self
->
attempt
->
lethality_level
(
$lethality_level
);
}
else
{
$lethality_level
=
$self
->
attempt
->
lethality_level
//
'
worker
';
}
if
((
defined
$failure_level
)
&&
!
$allowed_failure_levels
{
$failure_level
})
{
$msg
=
"
Unrecognized
\$
failure_level '
$failure_level
' whilst throwing:
\n
$msg
"
}
elsif
(
$failure_level
)
{
$self
->
attempt
->
failure_level
(
$failure_level
);
}
else
{
$failure_level
=
$self
->
attempt
->
failure_level
;
}
Bio::EnsEMBL::Hive::Utils::
throw
(
$msg
);
# this module doesn't import 'throw' to avoid namespace clash
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment