snippet-end:[gov2.bedrock-runtime.InvokeTitanImage]
(err error, modelId string)
| 151 | // snippet-end:[gov2.bedrock-runtime.InvokeTitanImage] |
| 152 | |
| 153 | func ProcessError(err error, modelId string) { |
| 154 | errMsg := err.Error() |
| 155 | if strings.Contains(errMsg, "no such host") { |
| 156 | log.Printf(`The Bedrock service is not available in the selected region. |
| 157 | Please double-check the service availability for your region at |
| 158 | https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/.\n`) |
| 159 | } else if strings.Contains(errMsg, "Could not resolve the foundation model") { |
| 160 | log.Printf(`Could not resolve the foundation model from model identifier: \"%v\". |
| 161 | Please verify that the requested model exists and is accessible |
| 162 | within the specified region.\n |
| 163 | `, modelId) |
| 164 | } else { |
| 165 | log.Printf("Couldn't invoke model: \"%v\". Here's why: %v\n", modelId, err) |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | // snippet-end:[gov2.bedrock-runtime.InvokeModelWrapper.complete] |
no test coverage detected