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";
88import { fetchWithRetry } from "./fetchWithRetry.ts" ;
99import { green , red } from "./logging.ts" ;
1010import { preProcessBody } from "./preProcessBody.ts" ;
11+ import { type SentryClient } from "../sentry.ts" ;
1112
1213interface GetPreSignedURLArgs {
1314 apiURL : string ;
1415 uploadToken ?: string ;
1516 serviceParams : Partial < ProviderServiceParams > ;
1617 retryCount ?: number ;
18+ sentryClient ?: SentryClient ;
1719}
1820
1921const PreSignedURLSchema = z . object ( {
@@ -25,6 +27,7 @@ export const getPreSignedURL = async ({
2527 uploadToken,
2628 serviceParams,
2729 retryCount = DEFAULT_RETRY_COUNT ,
30+ sentryClient,
2831} : GetPreSignedURLArgs ) => {
2932 if ( ! uploadToken ) {
3033 red ( "No upload token found" ) ;
@@ -38,7 +41,8 @@ export const getPreSignedURL = async ({
3841 response = await fetchWithRetry ( {
3942 url,
4043 retryCount,
41- name : "`get-pre-signed-url`" ,
44+ sentryClient,
45+ name : "get-pre-signed-url" ,
4246 requestData : {
4347 method : "POST" ,
4448 headers : {
Original file line number Diff line number Diff line change @@ -6,17 +6,20 @@ import { fetchWithRetry } from "./fetchWithRetry";
66import { DEFAULT_RETRY_COUNT } from "./constants" ;
77import { UploadLimitReachedError } from "../errors/UploadLimitReachedError" ;
88import { FailedFetchError } from "../errors/FailedFetchError" ;
9+ import { type SentryClient } from "../sentry.ts" ;
910
1011interface UploadStatsArgs {
1112 message : string ;
1213 preSignedUrl : string ;
1314 retryCount ?: number ;
15+ sentryClient ?: SentryClient ;
1416}
1517
1618export async function uploadStats ( {
1719 message,
1820 preSignedUrl,
1921 retryCount = DEFAULT_RETRY_COUNT ,
22+ sentryClient,
2023} : UploadStatsArgs ) {
2124 const iterator = message [ Symbol . iterator ] ( ) ;
2225 const stream = new ReadableStream ( {
@@ -36,7 +39,8 @@ export async function uploadStats({
3639 response = await fetchWithRetry ( {
3740 url : preSignedUrl ,
3841 retryCount,
39- name : "`upload-stats`" ,
42+ name : "upload-stats" ,
43+ sentryClient,
4044 requestData : {
4145 method : "PUT" ,
4246 headers : {
You can’t perform that action at this time.
0 commit comments