LCOV - code coverage report

Current view
top level - src/exceptions - squadron_canceled_exception.dart
Test
lcov.info
Date
2026-11-07
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines2727100.0%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'package:cancelation_token/cancelation_token.dart';
2import 'package:meta/meta.dart';
3
4import '_builtin_exceptions.dart';
5import 'squadron_canceled_exceptions.dart';
6import 'squadron_exception.dart';
7import 'squadron_timeout_exception.dart';
8
9class SquadronCanceledException extends SquadronException
10 implements CanceledException {
111 SquadronCanceledException(
12 this.tokenId, String message, StackTrace? stackTrace)
131 : super.init(message, stackTrace);
14
151 factory SquadronCanceledException.from(String tokenId, CanceledException ex,
16 [StackTrace? stackTrace]) {
171 if (ex is TimeoutCanceledException) {
181 return SquadronTimeoutException(
193 tokenId, ex.message, ex.duration, ex.stackTrace);
201 } else if (ex is CanceledExceptions) {
211 return SquadronCanceledExceptions(
22 tokenId,
232 ex.innerExceptions.map(
243 (e) => SquadronCanceledException.from(tokenId, e, e.stackTrace),
25 ),
26 );
27 } else {
283 return SquadronCanceledException(tokenId, ex.message, ex.stackTrace);
29 }
30 }
31
32 final String tokenId;
33
341 @override
352 List serialize() => List.unmodifiable([
36 $canceledExceptionType,
371 tokenId,
381 message,
392 stackTrace?.toString(),
40 ]);
41}
42
43const _$type = 0;
44const _$tokenId = 1;
45const _$message = 2;
46const _$stackTrace = 3;
47
48@internal
49extension SquadronCanceledExceptionExt on SquadronCanceledException {
501 static SquadronCanceledException? deserialize(List? props) {
51 if (props == null) return null;
521 switch (props[_$type]) {
531 case $canceledExceptionType:
541 return SquadronCanceledException(
551 props[_$tokenId],
561 props[_$message],
572 SquadronException.loadStackTrace(props[_$stackTrace]),
58 );
591 case $canceledExceptionsType:
601 return SquadronCanceledExceptionsExt.deserialize(props);
611 case $timeoutExceptionType:
621 return SquadronTimeoutExceptionExt.deserialize(props);
63 default:
64 return null;
65 }
66 }
67}
Choose Features