File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
packages/bundler-plugin-core/src/utils Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ import { DEFAULT_RETRY_COUNT } from "./constants.ts";
8
8
import { fetchWithRetry } from "./fetchWithRetry.ts" ;
9
9
import { green , red } from "./logging.ts" ;
10
10
import { preProcessBody } from "./preProcessBody.ts" ;
11
+ import { type SentryClient } from "../sentry.ts" ;
11
12
12
13
interface GetPreSignedURLArgs {
13
14
apiURL : string ;
14
15
uploadToken ?: string ;
15
16
serviceParams : Partial < ProviderServiceParams > ;
16
17
retryCount ?: number ;
18
+ sentryClient ?: SentryClient ;
17
19
}
18
20
19
21
const PreSignedURLSchema = z . object ( {
@@ -25,6 +27,7 @@ export const getPreSignedURL = async ({
25
27
uploadToken,
26
28
serviceParams,
27
29
retryCount = DEFAULT_RETRY_COUNT ,
30
+ sentryClient,
28
31
} : GetPreSignedURLArgs ) => {
29
32
if ( ! uploadToken ) {
30
33
red ( "No upload token found" ) ;
@@ -38,7 +41,8 @@ export const getPreSignedURL = async ({
38
41
response = await fetchWithRetry ( {
39
42
url,
40
43
retryCount,
41
- name : "`get-pre-signed-url`" ,
44
+ sentryClient,
45
+ name : "get-pre-signed-url" ,
42
46
requestData : {
43
47
method : "POST" ,
44
48
headers : {
Original file line number Diff line number Diff line change @@ -6,19 +6,22 @@ import { fetchWithRetry } from "./fetchWithRetry";
6
6
import { DEFAULT_RETRY_COUNT } from "./constants" ;
7
7
import { UploadLimitReachedError } from "../errors/UploadLimitReachedError" ;
8
8
import { FailedFetchError } from "../errors/FailedFetchError" ;
9
+ import { type SentryClient } from "../sentry.ts" ;
9
10
10
11
interface UploadStatsArgs {
11
12
message : string ;
12
13
bundleName : string ;
13
14
preSignedUrl : string ;
14
15
retryCount ?: number ;
16
+ sentryClient ?: SentryClient ;
15
17
}
16
18
17
19
export async function uploadStats ( {
18
20
message,
19
21
bundleName,
20
22
preSignedUrl,
21
23
retryCount = DEFAULT_RETRY_COUNT ,
24
+ sentryClient,
22
25
} : UploadStatsArgs ) {
23
26
const iterator = message [ Symbol . iterator ] ( ) ;
24
27
const stream = new ReadableStream ( {
@@ -38,7 +41,8 @@ export async function uploadStats({
38
41
response = await fetchWithRetry ( {
39
42
url : preSignedUrl ,
40
43
retryCount,
41
- name : "`upload-stats`" ,
44
+ name : "upload-stats" ,
45
+ sentryClient,
42
46
requestData : {
43
47
method : "PUT" ,
44
48
headers : {
You can’t perform that action at this time.
0 commit comments