Skip to content

Commit

Permalink
全てのエラーをログに出す
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexa committed Mar 6, 2024
1 parent 8ac6c9a commit 0a74e45
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions amazon_transcribe_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,16 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader)
}

if err := stream.Err(); err != nil {
zlog.Error().
Err(err).
Str("channel_id", h.ChannelID).
Str("connection_id", h.ConnectionID).
Int("retry_count", h.GetRetryCount()).
Send()

// 復帰が不可能なエラー以外は再接続を試みる
switch err.(type) {
case *transcribestreamingservice.LimitExceededException:
zlog.Error().
Err(err).
Str("channel_id", h.ChannelID).
Str("connection_id", h.ConnectionID).
Int("retry_count", h.GetRetryCount()).
Send()

// リトライしない設定の場合、または、max_retry を超えた場合はクライアントにエラーを返し、再度接続するかはクライアント側で判断する
if (at.Config.MaxRetry < 1) || (at.Config.MaxRetry <= h.GetRetryCount()) {
if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil {
Expand Down

0 comments on commit 0a74e45

Please sign in to comment.