Conditions | 4 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package dynamodb |
||
18 | func (svc *DynamoDB) XExistTable(ctx context.Context, name string) (bool, error) { |
||
19 | _, err := svc.DescribeTable(ctx, DescribeTableRequest{ |
||
20 | TableName: name, |
||
21 | }) |
||
22 | if err == nil { |
||
23 | return true, nil |
||
24 | } |
||
25 | |||
26 | if e, ok := err.(errors.ErrorData); ok { |
||
27 | if e.GetAWSErrCode() == "ResourceNotFoundException" { |
||
28 | return false, nil |
||
29 | } |
||
30 | } |
||
31 | return false, err |
||
32 | } |
||
33 |