| 1 | package LibTmux::X; | ||||||||||||
| 2 | 11 | ▶ | use v5.44; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 11 | ▶ | use overload '""' => sub ($self, @) { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.1
Subroutine
__ANON__: called CC=3 SCAR=12.0
| |||||||||||||
| 4 | 2 | ▶ | my $path = defined $self->{path} ? " at $self->{path}" : ''; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 5 | 2 | ▶ | return ref($self) . $path . ': ' . ($self->{message} // 'operation failed'); | ||||||||||
|
Condition50%1/2
$self->{"message"} // "operation failed"
MC/DC0%0/1
$self->{"message"} // "operation failed"
$self->{"message"}
Truth table50%1/2
A
A= $self->{"message"}
| |||||||||||||
| 6 | }, | ||||||||||||
| 7 | 11 | fallback => 1; | |||||||||||
| 8 | 55 | ▶ | sub new ($class, %details) { bless \%details, $class } | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 9 | 53 | ▶ | sub throw ($class, %details) { die $class->new(%details) } | ||||||||||
|
Subroutine
throw: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 10 | 0 | ▶ | sub message ($self) { $self->{message} } | ||||||||||
|
Subroutine
message: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 11 | 0 | ▶ | sub path ($self) { $self->{path} } | ||||||||||
|
Subroutine
path: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 12 | 0 | ▶ | sub entity ($self) { $self->{entity} } | ||||||||||
|
Subroutine
entity: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 13 | 0 | ▶ | sub expected ($self) { $self->{expected} } | ||||||||||
|
Subroutine
expected: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 14 | 0 | ▶ | sub received ($self) { $self->{received} } | ||||||||||
|
Subroutine
received: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 15 | 0 | ▶ | sub matched_ids ($self) { [($self->{matched_ids} // [])->@*] } | ||||||||||
|
Subroutine
matched_ids: not called CC=2 SCAR=17.9
Pod
documented
Condition0%0/2
$self->{"matched_ids"} // []
MC/DC0%0/1
$self->{"matched_ids"} // []
$self->{"matched_ids"}
Truth table0%0/2
A
A= $self->{"matched_ids"}
| |||||||||||||
| 16 | 0 | ▶ | sub count ($self) { $self->{count} } | ||||||||||
|
Subroutine
count: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 17 | 0 | ▶ | sub result ($self) { $self->{result} } | ||||||||||
|
Subroutine
result: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 18 | 0 | ▶ | sub dispatched ($self) { $self->{dispatched} } | ||||||||||
|
Subroutine
dispatched: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 19 | 2 | ▶ | sub details ($self) { +{%$self} } | ||||||||||
|
Subroutine
details: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 20 | |||||||||||||
| 21 | 11 | ▶ | package LibTmux::X::InvalidArgument { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 22 | |||||||||||||
| 23 | 11 | ▶ | package LibTmux::X::InvalidSelection { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 24 | |||||||||||||
| 25 | 11 | ▶ | package LibTmux::X::InvalidFilter { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 26 | |||||||||||||
| 27 | 11 | ▶ | package LibTmux::X::NoMatch { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 28 | |||||||||||||
| 29 | 11 | ▶ | package LibTmux::X::MultipleMatches { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 30 | |||||||||||||
| 31 | 11 | ▶ | package LibTmux::X::Unloaded { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 32 | |||||||||||||
| 33 | 11 | ▶ | package LibTmux::X::UnsupportedValue { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 34 | |||||||||||||
| 35 | 11 | ▶ | package LibTmux::X::Unsupported { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 36 | |||||||||||||
| 37 | 11 | ▶ | package LibTmux::X::Spawn { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 38 | |||||||||||||
| 39 | 11 | ▶ | package LibTmux::X::Timeout { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 40 | |||||||||||||
| 41 | 11 | ▶ | package LibTmux::X::Cancelled { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 42 | |||||||||||||
| 43 | 11 | ▶ | package LibTmux::X::OutputLimit { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 44 | |||||||||||||
| 45 | 11 | ▶ | package LibTmux::X::Transport { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 46 | |||||||||||||
| 47 | 11 | ▶ | package LibTmux::X::Codec { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 48 | |||||||||||||
| 49 | 11 | ▶ | package LibTmux::X::Command { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 50 | |||||||||||||
| 51 | 11 | ▶ | package LibTmux::X::NoServer { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 52 | |||||||||||||
| 53 | 11 | ▶ | package LibTmux::X::StaleReference { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 54 | |||||||||||||
| 55 | 11 | ▶ | package LibTmux::X::AcquisitionRace { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 56 | |||||||||||||
| 57 | 11 | ▶ | package LibTmux::X::QueryMismatch { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 58 | |||||||||||||
| 59 | 11 | package LibTmux::X::Creation { | |||||||||||
| 60 | 11 | ▶ | use parent -norequire, 'LibTmux::X'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 61 | 0 | ▶ | sub created ($self) { $self->{created} } | ||||||||||
|
Subroutine
created: not called CC=1 SCAR=6.9
| |||||||||||||
| 62 | 0 | ▶ | sub cause ($self) { $self->{cause} } | ||||||||||
|
Subroutine
cause: not called CC=1 SCAR=6.9
| |||||||||||||
| 63 | } | ||||||||||||
| 64 | |||||||||||||
| 65 | 11 | ▶ | package LibTmux::X::NoSuchTarget { use parent -norequire, 'LibTmux::X' } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 66 | |||||||||||||
| 67 | =head1 NAME | ||||||||||||
| 68 | |||||||||||||
| 69 | LibTmux::X - Typed failures with readable diagnostics | ||||||||||||
| 70 | |||||||||||||
| 71 | =head1 DESCRIPTION | ||||||||||||
| 72 | |||||||||||||
| 73 | Errors stringify with class, path, and message. L</Creation> retains its | ||||||||||||
| 74 | original acquisition exception separately through C<cause>. C<details> returns | ||||||||||||
| 75 | diagnostic fields. Acquisition failures never represent an empty selection. | ||||||||||||
| 76 | |||||||||||||
| 77 | =head1 METHODS | ||||||||||||
| 78 | |||||||||||||
| 79 | =head2 new | ||||||||||||
| 80 | |||||||||||||
| 81 | C<new(%details)> constructs an exception object without throwing or I/O. | ||||||||||||
| 82 | |||||||||||||
| 83 | =head2 throw | ||||||||||||
| 84 | |||||||||||||
| 85 | C<throw(%details)> throws one exception object of the receiving class. | ||||||||||||
| 86 | |||||||||||||
| 87 | =head2 message | ||||||||||||
| 88 | |||||||||||||
| 89 | Return the human-readable failure description. | ||||||||||||
| 90 | |||||||||||||
| 91 | =head2 path | ||||||||||||
| 92 | |||||||||||||
| 93 | Return the criterion or argument path, or undef when inapplicable. | ||||||||||||
| 94 | |||||||||||||
| 95 | =head2 entity | ||||||||||||
| 96 | |||||||||||||
| 97 | Return the entity kind, or undef when inapplicable. | ||||||||||||
| 98 | |||||||||||||
| 99 | =head2 expected | ||||||||||||
| 100 | |||||||||||||
| 101 | Return the expected operand description, or undef. | ||||||||||||
| 102 | |||||||||||||
| 103 | =head2 received | ||||||||||||
| 104 | |||||||||||||
| 105 | Return the received operand description, or undef. | ||||||||||||
| 106 | |||||||||||||
| 107 | =head2 matched_ids | ||||||||||||
| 108 | |||||||||||||
| 109 | Return a fresh arrayref of observed matching IDs, including duplicate occurrences. | ||||||||||||
| 110 | |||||||||||||
| 111 | =head2 count | ||||||||||||
| 112 | |||||||||||||
| 113 | Return the observed cardinality lower bound where applicable. | ||||||||||||
| 114 | |||||||||||||
| 115 | =head2 result | ||||||||||||
| 116 | |||||||||||||
| 117 | Return a completed or bounded partial L<LibTmux::CommandResult>, or undef before process dispatch. | ||||||||||||
| 118 | |||||||||||||
| 119 | =head2 dispatched | ||||||||||||
| 120 | |||||||||||||
| 121 | Return whether the request was submitted where known; undef means no dispatch evidence was recorded. This never proves rollback. | ||||||||||||
| 122 | |||||||||||||
| 123 | =head2 details | ||||||||||||
| 124 | |||||||||||||
| 125 | Return a fresh shallow hashref of diagnostic fields. Causes and entity handles retain their identity. | ||||||||||||
| 126 | |||||||||||||
| 127 | =head2 created | ||||||||||||
| 128 | |||||||||||||
| 129 | Creation failures expose a minimal generation-scoped entity receipt, or undef. Only L<LibTmux::X/Creation> provides this method. | ||||||||||||
| 130 | |||||||||||||
| 131 | =head2 cause | ||||||||||||
| 132 | |||||||||||||
| 133 | Return the original acquisition exception for L<LibTmux::X/Creation>. | ||||||||||||
| 134 | |||||||||||||
| 135 | =head1 CARDINALITY AND DATA FAILURES | ||||||||||||
| 136 | |||||||||||||
| 137 | =head2 NoMatch | ||||||||||||
| 138 | |||||||||||||
| 139 | No occurrence matched one(). | ||||||||||||
| 140 | |||||||||||||
| 141 | =head2 MultipleMatches | ||||||||||||
| 142 | |||||||||||||
| 143 | At least two occurrences matched. matched_ids preserves occurrence diagnostics. | ||||||||||||
| 144 | |||||||||||||
| 145 | =head2 InvalidFilter | ||||||||||||
| 146 | |||||||||||||
| 147 | Invalid criteria data; path, expected, and received describe the boundary. | ||||||||||||
| 148 | |||||||||||||
| 149 | =head2 InvalidSelection | ||||||||||||
| 150 | |||||||||||||
| 151 | Undefined, hole, wrong-kind, or incompatible-generation membership. | ||||||||||||
| 152 | |||||||||||||
| 153 | =head2 InvalidArgument | ||||||||||||
| 154 | |||||||||||||
| 155 | Invalid operation or transport argument before dispatch. | ||||||||||||
| 156 | |||||||||||||
| 157 | =head2 Unloaded | ||||||||||||
| 158 | |||||||||||||
| 159 | A required field or relation is not available in captured data. | ||||||||||||
| 160 | |||||||||||||
| 161 | =head2 UnsupportedValue | ||||||||||||
| 162 | |||||||||||||
| 163 | A local value has no supported portable wire representation. | ||||||||||||
| 164 | |||||||||||||
| 165 | =head2 Unsupported | ||||||||||||
| 166 | |||||||||||||
| 167 | A daemon or execution capability is unavailable. | ||||||||||||
| 168 | |||||||||||||
| 169 | =head2 AcquisitionRace | ||||||||||||
| 170 | |||||||||||||
| 171 | Observed generations or topology changed during capture. | ||||||||||||
| 172 | |||||||||||||
| 173 | =head2 QueryMismatch | ||||||||||||
| 174 | |||||||||||||
| 175 | Native candidates disagree with captured local matches, or an expert native | ||||||||||||
| 176 | query returned an uncaptured ID. C<details-E<gt>{verification}> contains the | ||||||||||||
| 177 | detached L<LibTmux::Server/VERIFICATION REPORT>. The cause may be concurrent | ||||||||||||
| 178 | change, a translation defect or backend semantics; the comparison does not | ||||||||||||
| 179 | identify it. L<LibTmux::Server/query_panes> throws this for require or expert | ||||||||||||
| 180 | queries, while auto reports fallback through its optional observer. | ||||||||||||
| 181 | |||||||||||||
| 182 | =head2 StaleReference | ||||||||||||
| 183 | |||||||||||||
| 184 | A captured generation or contextual target no longer identifies the same resource. | ||||||||||||
| 185 | |||||||||||||
| 186 | =head2 Spawn | ||||||||||||
| 187 | |||||||||||||
| 188 | The executable could not start; dispatch is distinguished from command failure. | ||||||||||||
| 189 | |||||||||||||
| 190 | =head2 NoServer | ||||||||||||
| 191 | |||||||||||||
| 192 | The selected server cannot be reached. | ||||||||||||
| 193 | |||||||||||||
| 194 | =head2 Command | ||||||||||||
| 195 | |||||||||||||
| 196 | tmux reported nonzero status; result retains stdout/stderr/status. | ||||||||||||
| 197 | |||||||||||||
| 198 | =head2 Timeout | ||||||||||||
| 199 | |||||||||||||
| 200 | Execution exceeded its deadline; effects may already have occurred. | ||||||||||||
| 201 | |||||||||||||
| 202 | =head2 Cancelled | ||||||||||||
| 203 | |||||||||||||
| 204 | Execution was cancelled; cancellation does not roll back effects. | ||||||||||||
| 205 | |||||||||||||
| 206 | =head2 OutputLimit | ||||||||||||
| 207 | |||||||||||||
| 208 | Retained process output exceeded the configured bound. | ||||||||||||
| 209 | |||||||||||||
| 210 | =head2 Transport | ||||||||||||
| 211 | |||||||||||||
| 212 | Process supervision or result framing failed. | ||||||||||||
| 213 | |||||||||||||
| 214 | =head2 Codec | ||||||||||||
| 215 | |||||||||||||
| 216 | A tmux record or field could not be decoded. | ||||||||||||
| 217 | |||||||||||||
| 218 | =head2 NoSuchTarget | ||||||||||||
| 219 | |||||||||||||
| 220 | The selected stable target no longer exists. Native result diagnostics are | ||||||||||||
| 221 | retained. This differs from a stale generation and from an arbitrary command | ||||||||||||
| 222 | failure; acquire a new snapshot before choosing recovery. | ||||||||||||
| 223 | |||||||||||||
| 224 | =head2 Creation | ||||||||||||
| 225 | |||||||||||||
| 226 | A creation command succeeded but subsequent receipt decoding or capture failed. | ||||||||||||
| 227 | C<created> returns a minimal generation-scoped entity handle when the command's | ||||||||||||
| 228 | receipt was decoded; other fields remain unloaded. C<cause> preserves the | ||||||||||||
| 229 | original acquisition failure. C<dispatched> is true. The returned handle permits | ||||||||||||
| 230 | explicit, generation-checked cleanup; absent receipts leave effects uncertain. | ||||||||||||
| 231 | See L<LibTmux::Server/new_session>. | ||||||||||||
| 232 | |||||||||||||
| 233 | =head1 DIAGNOSTICS | ||||||||||||
| 234 | |||||||||||||
| 235 | C<message>, C<path>, C<entity>, C<expected>, C<received>, C<matched_ids>, | ||||||||||||
| 236 | C<count>, C<result>, C<dispatched>, and C<details> expose applicable fields. | ||||||||||||
| 237 | See L<LibTmux::Selection/one>, L<LibTmux::Filter/new>, and | ||||||||||||
| 238 | L<LibTmux::Server> for failure boundaries. | ||||||||||||
| 239 | |||||||||||||
| 240 | =cut | ||||||||||||