mirror of
https://github.com/rustfs/console.git
synced 2026-09-01 15:17:45 +08:00
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:
@@ -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 = '{}';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user