Skip to content

Commit 1355655

Browse files
committed
Updated logic
1 parent 657d0a3 commit 1355655

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/lib/task/backend.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,11 +1153,11 @@ PackageVersionStateInfo _authorizeWorkerCallback(
11531153

11541154
final versionState = state.versions![version];
11551155
if (versionState == null) {
1156-
throw NotFoundException.resource('$package/$version');
1156+
throw TaskAbortedException('The provided token is invalid or expired.');
11571157
}
11581158
// Check the secret token
11591159
if (!versionState.isAuthorized(token)) {
1160-
throw AuthenticationException.authenticationRequired();
1160+
throw TaskAbortedException('The provided token is invalid or expired.');
11611161
}
11621162
assert(versionState.scheduled != initialTimestamp);
11631163
assert(versionState.instance != null);

app/test/task/task_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,9 +784,9 @@ void main() {
784784
final api = createPubApiClient(authToken: v.token);
785785
await expectApiException(
786786
api.taskUploadFinished('neon', v.version),
787-
status: 404,
788-
code: 'NotFound',
789-
message: 'Could not find `neon/1.0.0`.',
787+
status: 400,
788+
code: 'TaskAborted',
789+
message: 'The provided token is invalid or expired.',
790790
);
791791
}
792792

0 commit comments

Comments
 (0)