Skip to content

Commit 7ec7cab

Browse files
authored
Extend pub_worker-related NotFound exception with additional context. (#9047)
1 parent fda20b6 commit 7ec7cab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/lib/task/backend.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,9 @@ class TaskBackend {
610610

611611
final state = await _db.tasks.lookupOrNull(package);
612612
if (state == null) {
613-
throw NotFoundException.resource('$package/$version');
613+
throw NotFoundException.resource(
614+
'PackageState($runtimeVersion/$package)',
615+
);
614616
}
615617
final versionState = _authorizeWorkerCallback(
616618
package,
@@ -686,7 +688,9 @@ class TaskBackend {
686688
await withRetryTransaction(_db, (tx) async {
687689
final state = await tx.tasks.lookupOrNull(package);
688690
if (state == null) {
689-
throw NotFoundException.resource('$package/$version');
691+
throw NotFoundException.resource(
692+
'PackageState($runtimeVersion/$package)',
693+
);
690694
}
691695
final versionState = _authorizeWorkerCallback(
692696
package,

0 commit comments

Comments
 (0)