LCOV - code coverage report

Current view
top level - src/exceptions - worker_exception.dart
Test
lcov.info
Date
2024-11-13
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines1818100.0%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'package:meta/meta.dart';
2
3import '_well_known_exceptions.dart';
4import 'squadron_exception.dart';
5
6/// Exception to keep track of errors encountered in a worker.
7class WorkerException extends SquadronException {
8 /// Creates a new [WorkerException] to capture error context.
910 WorkerException(super.message, [super.stackTrace, int? command])
10 : _command = command,
1110 super.init();
12
135 @override
1412 List serialize() => List.unmodifiable([
15 $workerExceptionType,
167 message,
1712 stackTrace?.toString(),
187 _command,
192 ]);
20
21 /// Command.
226 int? get command => _command;
23 int? _command;
24}
25
26const _$type = 0;
27const _$message = 1;
28const _$stackTrace = 2;
29const _$command = 3;
30
31@internal
32extension WorkerExceptionExt on WorkerException {
334 void setCommand(int command) {
349 _command = command;
35 }
36
3711 static WorkerException? deserialize(List data) =>
3816 (data[_$type] == $workerExceptionType)
3911 ? WorkerException(
4011 data[_$message],
4116 SquadronException.loadStackTrace(data[_$stackTrace]),
4216 (data[_$command] as num?)?.toInt(),
43 )
446 : null;
45}
Choose Features