Skip to content

Commit f10151d

Browse files
committed
Add amzn error extractor to restjson client protocol
1 parent efe0185 commit f10151d

File tree

1 file changed

+9
-2
lines changed
  • packages/smithy-aws-core/src/smithy_aws_core/aio

1 file changed

+9
-2
lines changed

packages/smithy-aws-core/src/smithy_aws_core/aio/protocols.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22

33
from smithy_core.codecs import Codec
44
from smithy_core.shapes import ShapeID
5+
from smithy_http.aio.interfaces import ErrorExtractor
56
from smithy_http.aio.protocols import HttpBindingClientProtocol
67
from smithy_json import JSONCodec
78

89
from ..traits import RestJson1Trait
10+
from . import AmznErrorExtractor
911

1012

1113
class RestJsonClientProtocol(HttpBindingClientProtocol):
1214
"""An implementation of the aws.protocols#restJson1 protocol."""
1315

1416
_id: ShapeID = RestJson1Trait.id
1517
_codec: JSONCodec = JSONCodec()
16-
_contentType: Final = "application/json"
18+
_content_type: Final = "application/json"
19+
_error_extractor: ErrorExtractor = AmznErrorExtractor()
1720

1821
@property
1922
def id(self) -> ShapeID:
@@ -25,4 +28,8 @@ def payload_codec(self) -> Codec:
2528

2629
@property
2730
def content_type(self) -> str:
28-
return self._contentType
31+
return self._content_type
32+
33+
@property
34+
def error_extractor(self) -> ErrorExtractor:
35+
return self._error_extractor

0 commit comments

Comments
 (0)