Pipeline/Stop.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Pipeline/Errors.pm ↑ Summary Pipeline/Tooling.pm »
1 23 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package Ekorn::Pipeline::Stop;
4  
5 23 ▶use Exporter qw(import);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 23 ▶use namespace::clean -except => 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 23 ▶use overload '""' => sub { "Stop used outside a pipeline\n" }, fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
10  
11 23 our @EXPORT = qw(Stop); ## no critic (Modules::ProhibitAutomaticExportation)
12  
13 # Syntactic sugar throwing the exception that stops a pipeline early.
14 105 ▶sub Stop (@data) {
Subroutine Stop: called CC=1 SCAR=0.0
Pod documented
15 105 return __PACKAGE__->throw(@data);
16 }
17  
18 # Throws an exception that stops a pipeline early.
19 #
20 # It's thrown with die, not croak, though croak is our rule for what we
21 # pass on. Given an object, croak dies with it unchanged, adding no
22 # location, so it gives catchers nothing die doesn't; but it does
23 # Carp's work first, which made a stop about three times dearer: 1.4
24 # microseconds against 0.42, as DBIx-Squirrel measured on 2026-11-14,
25 # on Perl 5.36 and 5.44.
26 214 ▶sub throw ($class, @data) {
Subroutine throw: called CC=1 SCAR=0.0
Pod documented
27 214 die bless([$class, @data], $class); ## no critic (ErrorHandling::RequireCarping)
28 }
29  
30 23 1;
31 __END__
« Pipeline/Errors.pm ↑ Summary Pipeline/Tooling.pm »