Skip to content

Commit c90e04f

Browse files
ekristencorybekk
authored andcommitted
fix(transcribe): skip unsupported regions
1 parent 1914aa5 commit c90e04f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

resources/transcribe-call-analytics-category.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package resources
22

33
import (
44
"context"
5+
"errors"
6+
"strings"
57
"time"
68

79
"github.com/aws/aws-sdk-go/service/transcribeservice"
@@ -39,6 +41,11 @@ func (l *TranscribeCallAnalyticsCategoryLister) List(_ context.Context, o interf
3941

4042
listOutput, err := svc.ListCallAnalyticsCategories(listCallAnalyticsCategoriesInput)
4143
if err != nil {
44+
var badRequestException *transcribeservice.BadRequestException
45+
if errors.As(err, &badRequestException) &&
46+
strings.Contains(badRequestException.Message(), "isn't supported in this region") {
47+
return resources, nil
48+
}
4249
return nil, err
4350
}
4451
for _, category := range listOutput.Categories {

resources/transcribe-call-analytics-job.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package resources
22

33
import (
44
"context"
5+
"errors"
6+
"strings"
57
"time"
68

79
"github.com/aws/aws-sdk-go/aws"
@@ -41,8 +43,13 @@ func (l *TranscribeCallAnalyticsJobLister) List(_ context.Context, o interface{}
4143

4244
listOutput, err := svc.ListCallAnalyticsJobs(listCallAnalyticsJobsInput)
4345
if err != nil {
44-
return nil, err
46+
var badRequestException *transcribeservice.BadRequestException
47+
if errors.As(err, &badRequestException) &&
48+
strings.Contains(badRequestException.Message(), "isn't supported in this region") {
49+
return resources, nil
50+
}
4551
}
52+
4653
for _, job := range listOutput.CallAnalyticsJobSummaries {
4754
resources = append(resources, &TranscribeCallAnalyticsJob{
4855
svc: svc,

0 commit comments

Comments
 (0)