File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2211,12 +2211,8 @@ namespace Aws
22112211 }
22122212 else
22132213 {
2214- // Horribly awkward cast due to the infuriating original API design
2215- Crt::Allocator *allocator = m_allocator;
2216- auto errorResponse = Crt::ScopedResource<OperationError>(
2217- static_cast <OperationError *>(result.m_message .value ().m_shape .release ()),
2218- [allocator](OperationError *shape) { Crt::Delete (shape, allocator); });
2219-
2214+ auto errorResponse = Crt::SafeSubCast<AbstractShapeBase, OperationError>(
2215+ std::move (result.m_message .value ().m_shape ));
22202216 activationResultCallback (EventstreamResultVariantType (std::move (errorResponse)));
22212217 }
22222218 }
@@ -2248,11 +2244,8 @@ namespace Aws
22482244
22492245 case EventStreamMessageRoutingType::Error:
22502246 {
2251- Crt::Allocator *allocator = m_allocator;
2252- auto errorResponse = Crt::ScopedResource<OperationError>(
2253- static_cast <OperationError *>(shape.release ()),
2254- [allocator](OperationError *shape) { Crt::Delete (shape, allocator); });
2255-
2247+ auto errorResponse =
2248+ Crt::SafeSubCast<AbstractShapeBase, OperationError>(std::move (shape));
22562249 shouldClose = streamHandler->OnStreamError (
22572250 std::move (errorResponse), {EVENT_STREAM_RPC_SUCCESS, 0 });
22582251 break ;
You can’t perform that action at this time.
0 commit comments