In the bedrock components, document_embeder.py#L219, generator.py#L236, there is an exception catch on run which then produces a message about it being a connection error regardless of the underlying issue.
except ClientError as exception:
msg = (
f"Could not connect to Amazon Bedrock model {self.model}. "
f"Make sure your AWS environment is configured correctly, "
f"the model is available in the configured AWS region, and you have access."
)
raise AmazonBedrockInferenceError(msg) from exception
This assumes it's always the connection issue and is misleading in cases there is another underlying issue (e.g. the token count being too high).
Desired behavior
It should either surface the underlying error directly or configure the message to be specific to possible / common issues.
In this sense, the ranker handling seems to be better:
ranker.py#L254
In the bedrock components, document_embeder.py#L219, generator.py#L236, there is an exception catch on run which then produces a message about it being a connection error regardless of the underlying issue.
This assumes it's always the connection issue and is misleading in cases there is another underlying issue (e.g. the token count being too high).
Desired behavior
It should either surface the underlying error directly or configure the message to be specific to possible / common issues.
In this sense, the ranker handling seems to be better:
ranker.py#L254