mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 00:03:27 +10:00
fix: throw appropriate errors when connecting to storage bucket, closes #1561
This commit is contained in:
@ -67,8 +67,21 @@ export class StorageService implements OnModuleInit {
|
||||
this.bucketName,
|
||||
);
|
||||
|
||||
await this.client.makeBucket(this.bucketName);
|
||||
await this.client.setBucketPolicy(this.bucketName, bucketPolicy);
|
||||
try {
|
||||
await this.client.makeBucket(this.bucketName);
|
||||
} catch (error) {
|
||||
throw new InternalServerErrorException(
|
||||
"There was an error while creating the storage bucket.",
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
await this.client.setBucketPolicy(this.bucketName, bucketPolicy);
|
||||
} catch (error) {
|
||||
throw new InternalServerErrorException(
|
||||
"There was an error while applying the policy to the storage bucket.",
|
||||
);
|
||||
}
|
||||
|
||||
this.logger.log(
|
||||
"A new storage bucket has been created and the policy has been applied successfully.",
|
||||
@ -77,9 +90,7 @@ export class StorageService implements OnModuleInit {
|
||||
this.logger.log("Successfully connected to the storage service.");
|
||||
}
|
||||
} catch (error) {
|
||||
throw new InternalServerErrorException(
|
||||
"There was an error while creating the storage bucket.",
|
||||
);
|
||||
throw new InternalServerErrorException(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -137,7 +137,7 @@
|
||||
"@nestjs/terminus": "^10.1.1",
|
||||
"@paralleldrive/cuid2": "^2.2.2",
|
||||
"@pdf-lib/fontkit": "^1.1.1",
|
||||
"@phosphor-icons/react": "^2.0.14",
|
||||
"@phosphor-icons/react": "^2.0.15",
|
||||
"@prisma/client": "^5.6.0",
|
||||
"@radix-ui/react-accordion": "^1.1.2",
|
||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||
|
||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@ -78,8 +78,8 @@ dependencies:
|
||||
specifier: ^1.1.1
|
||||
version: 1.1.1
|
||||
'@phosphor-icons/react':
|
||||
specifier: ^2.0.14
|
||||
version: 2.0.14(react-dom@18.2.0)(react@18.2.0)
|
||||
specifier: ^2.0.15
|
||||
version: 2.0.15(react-dom@18.2.0)(react@18.2.0)
|
||||
'@prisma/client':
|
||||
specifier: ^5.6.0
|
||||
version: 5.6.0(prisma@5.6.0)
|
||||
@ -4420,8 +4420,8 @@ packages:
|
||||
typescript: 5.3.2
|
||||
dev: true
|
||||
|
||||
/@phosphor-icons/react@2.0.14(react-dom@18.2.0)(react@18.2.0):
|
||||
resolution: {integrity: sha512-VaZ7/JEQ7dW+Up23l7t6lqJ3dPJupM03916Pat+ZOLX1vex9OeX9t8RZLJWt0oVrdc/GcrAyRD5FESDeP+M4tQ==}
|
||||
/@phosphor-icons/react@2.0.15(react-dom@18.2.0)(react@18.2.0):
|
||||
resolution: {integrity: sha512-PQKNcRrfERlC8gJGNz0su0i9xVmeubXSNxucPcbCLDd9u0cwJVTEyYK87muul/svf0UXFdL2Vl6bbeOhT1Mwow==}
|
||||
engines: {node: '>=10'}
|
||||
peerDependencies:
|
||||
react: '>= 16.8'
|
||||
|
||||
Reference in New Issue
Block a user