File: cust_example_test.go

package info (click to toggle)
golang-github-aws-aws-sdk-go 1.36.33-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 163,900 kB
  • sloc: makefile: 182
file content (23 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package dynamodb_test

import (
	"log"

	"github.com/aws/aws-sdk-go/awstesting/unit"
	"github.com/aws/aws-sdk-go/service/dynamodb"
)

func ExampleDynamoDB_TransactWriteItems_transactionCanceledException() {
	client := dynamodb.New(unit.Session)

	_, err := client.TransactWriteItems(&dynamodb.TransactWriteItemsInput{})
	if err != nil {
		switch t := err.(type) {
		case *dynamodb.TransactionCanceledException:
			log.Fatalf("failed to write items: %s\n%v",
				t.Message(), t.CancellationReasons)
		default:
			log.Fatalf("failed to write items: %v", err)
		}
	}
}