Skip to content

Throw error on request close event in NodeHttp2Handler if it's value other than NGHTTP2_NO_ERROR (0) #2556

@trivikr

Description

@trivikr

Is your feature request related to a problem? Please describe.

When http2stream throws error with http2stream.rstCode other than NGHTTP2_NO_ERROR (0), the error thrown contains undefined. This was seen while discovering another bug with parallel streaming in https://github.com/jjtindale/aws-parallel-transcribe-repro

Error: AWS SDK error wrapper for undefined
    at asSdkError (/Users/joe/Development/amazon-transcribe-error/node_modules/@aws-sdk/middleware-retry/src/StandardRetryStrategy.ts:124:10)
    at StandardRetryStrategy.retry (/Users/joe/Development/amazon-transcribe-error/node_modules/@aws-sdk/middleware-retry/src/StandardRetryStrategy.ts:94:21)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at /Users/joe/Development/amazon-transcribe-error/node_modules/@aws-sdk/middleware-sdk-transcribe-streaming/src/middleware-session-id.ts:32:22
    at /Users/joe/Development/amazon-transcribe-error/node_modules/@aws-sdk/middleware-logger/src/loggerMiddleware.ts:22:22 {
  '$metadata': { attempts: 1, totalRetryDelay: 0 }
}

Code:

// The HTTP/2 error code used when closing the stream can be retrieved using the
// http2stream.rstCode property. If the code is any value other than NGHTTP2_NO_ERROR (0),
// an 'error' event will have also been emitted.

Describe the solution you'd like

Throw error on request close event in NodeHttp2Handler if it's value other than NGHTTP2_NO_ERROR (0).

Describe alternatives you've considered

Writing my own custom implementation of NodeHttp2Handler which throws an error

Additional context

Follow-up to #2550

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions