File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
packages/thirdweb/src/storage/upload Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ improve error handling for 402 and 403 error codes in storage upload
Original file line number Diff line number Diff line change @@ -30,6 +30,16 @@ export async function uploadBatch<const TFiles extends UploadableFile[]>(
30
30
"Unauthorized - You don't have permission to use this service." ,
31
31
) ;
32
32
}
33
+ if ( res . status === 402 ) {
34
+ throw new Error (
35
+ "You have reached your storage limit. Please add a valid payment method to continue using the service." ,
36
+ ) ;
37
+ }
38
+ if ( res . status === 403 ) {
39
+ throw new Error (
40
+ "Forbidden - You don't have permission to use this service." ,
41
+ ) ;
42
+ }
33
43
throw new Error (
34
44
`Failed to upload files to IPFS - ${ res . status } - ${ res . statusText } ` ,
35
45
) ;
You can’t perform that action at this time.
0 commit comments