LCOV - code coverage report

Current view
top level - src/exceptions - worker_exception.dart
Test
lcov.info
Date
2026-11-07
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines1616100.0%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'package:meta/meta.dart';
2
3import '_builtin_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.
91 WorkerException(super.message, [super.stackTrace, int? command])
10 : _command = command,
111 super.init();
12
131 @override
142 List serialize() => List.unmodifiable([
15 $workerExceptionType,
161 message,
172 stackTrace?.toString(),
181 _command,
19 ]);
20
21 /// Command.
222 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 WorkerExceptionImpl on WorkerException {
331 void setCommand(int command) {
341 _command = command;
35 }
36
371 static WorkerException? deserialize(List data) =>
382 (data[_$type] == $workerExceptionType)
391 ? WorkerException(
401 data[_$message],
412 SquadronException.loadStackTrace(data[_$stackTrace]),
422 (data[_$command] as num?)?.toInt(),
43 )
44 : null;
45}
Choose Features