fix: bucket policy 404

If the bucket policy API return 404 (or any other error being catched),
display the bucket policy as 'private' and content as '{}'
This commit is contained in:
heimoshuiyu
2025-07-20 18:54:20 +08:00
parent 8918ccee2c
commit c3490eea0e
+7 -2
View File
@@ -351,8 +351,13 @@ const getbucketPolicy = async () => {
} else {
bucketPolicy.value = 'public';
}
} catch (error) {
// console.error("Error fetching bucket policy:", error)
} catch (error: any) {
// Handle 404 error when no policy exists
console.error("Error fetching bucket policy:", error);
// Set default values for private policy
bucketPolicy.value = 'private';
policyFormValue.value.policy = 'private';
policyFormValue.value.content = '{}';
}
};