mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-23 22:20:23 +09:00
Improve AWS Bedrock Configuration Error Handling
- Enhanced error messages in `getAwsCredentials` to provide clearer feedback when AWS Bedrock is not configured properly. - Added checks for missing Bedrock Access Key ID and Secret Access Key, with specific error messages for each case.
This commit is contained in:
parent
04cbadb197
commit
4093e4c500
@ -15,7 +15,15 @@ const ALLOWED_PATH = new Set([BedrockConfig.ChatPath]);
|
||||
function getAwsCredentials() {
|
||||
const config = getServerSideConfig();
|
||||
if (!config.isBedrock) {
|
||||
throw new Error("AWS Bedrock is not configured properly");
|
||||
throw new Error(
|
||||
"AWS Bedrock is not configured properly (ENABLE_AWS_BEDROCK is not true)",
|
||||
);
|
||||
}
|
||||
if (!config.bedrockAccessKeyId) {
|
||||
throw new Error("AWS Bedrock Access Key ID is missing or empty.");
|
||||
}
|
||||
if (!config.bedrockSecretAccessKey) {
|
||||
throw new Error("AWS Bedrock Secret Access Key is missing or empty.");
|
||||
}
|
||||
return {
|
||||
accessKeyId: config.bedrockAccessKeyId as string,
|
||||
|
Loading…
Reference in New Issue
Block a user