id stringlengths 22 133 | text stringlengths 40 40.2k | arch stringclasses 1
value | syntax stringclasses 1
value | kind stringclasses 4
values | repo stringclasses 27
values | path stringlengths 5 116 | license stringclasses 6
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 16
values | source_url stringlengths 85 196 | line_start int64 1 4.28k | line_end int64 4 4.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"DestinationInterceptor\") }, connection: Unknown } })""#.to_string();
interceptor_error_redirection_test!(
modify_before_sig... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | interceptor_error_redirection_test!(
modify_before_transmit,
&mut BeforeTransmitInterceptorContextMut<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 841 | 900 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:23 | interceptor_error_redirection_test!(
modify_before_deserialization,
&mut BeforeDeserializationInterceptorContextMut<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterAttempt, source: Some(\"DestinationInterceptor\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inner: Once(Some(b\"\")), retryable: true } } })""#.to_string();
interceptor_error_redirect... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | &runtime_plugins(),
StopPoint::None,
)
.await
.expect("success");
assert!(context.response().is_some());
// StopPoint::BeforeTransmit will exit right before sending the request, so there should be no response
let context = invoke_with_stop_point(
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 961 | 1,020 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | .store(true, Ordering::Relaxed);
Err("test error".into())
}
fn modify_before_completion(
&self,
_context: &mut FinalizerInterceptorContextMut<'_>,
_cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
self.i... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,001 | 1,060 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:27 | }
}
let interceptor = TestInterceptor::default();
let runtime_plugins = || {
RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin)
.with_operation_plugin(AnonymousAuthRuntimePlugin::new())
.with_operation_plugin(Test... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,041 | 1,077 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// TODO(msrvUpgrade): This can be removed once we upgrade the MSRV to Rust 1.69
#![allow(unknown_lints)]
use self::auth::orchestrate_auth;
use crate::client::orchestrator::endpoints::orchestrate_endpoin... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:2 | }
macro_rules! halt_on_err {
([$ctx:ident] => $expr:expr) => {
match $expr {
Ok(ok) => ok,
Err(err) => halt!([$ctx] => err),
}
};
}
macro_rules! continue_on_err {
([$ctx:ident] => $expr:expr) => {
if let Err(err) = $expr {
debug!("encountered orc... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:3 | #[tracing::instrument(skip_all, name = "invoke")]
pub async fn invoke_with_stop_point(
input: Input,
runtime_plugins: &RuntimePlugins,
stop_point: StopPoint,
) -> Result<InterceptorContext, SdkError<Error, HttpResponse>> {
let mut cfg = ConfigBag::base();
let cfg = &mut cfg;
let mut interceptor... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | continue_on_err!([ctx] => interceptors.client_read_before_execution(ctx, cfg));
runtime_plugins
.apply_operation_configuration(cfg, interceptors.operation_interceptors_mut())?;
continue_on_err!([ctx] => interceptors.operation_read_before_execution(ctx, cfg));
Ok(())
}
#[instrument(skip_all)]
async... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | ctx.enter_before_transmit_phase();
halt_on_err!([ctx] => interceptors.read_after_serialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_retry_loop(ctx, cfg));
let retry_strategy = cfg.retry_strategy();
// If we got a retry strategy from the bag, ask it what to do.
// Otherwise, ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | try_attempt(ctx, cfg, interceptors, stop_point).await;
finally_attempt(ctx, cfg, interceptors).await;
Result::<_, SdkError<Error, HttpResponse>>::Ok(())
}
.maybe_timeout_with_config(attempt_timeout_config)
.await
.map_err(|err| OrchestratorError::timeout(err.into_... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | #[instrument(skip_all)]
async fn try_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
interceptors: &Interceptors,
stop_point: StopPoint,
) {
halt_on_err!([ctx] => interceptors.read_before_attempt(ctx, cfg));
halt_on_err!([ctx] => orchestrate_endpoint(ctx, cfg).map_err(OrchestratorErr... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | halt_on_err!([ctx] => interceptors.read_before_deserialization(ctx, cfg));
ctx.enter_deserialization_phase();
let output_or_error = async {
let response = ctx.response_mut().expect("set during transmit");
let response_deserializer = cfg.response_deserializer();
match response_deserializ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | }
#[cfg(all(test, feature = "test-util", feature = "anonymous-auth"))]
mod tests {
use super::invoke;
use crate::client::orchestrator::endpoints::{
StaticUriEndpointResolver, StaticUriEndpointResolverParams,
};
use crate::client::orchestrator::{invoke_with_stop_point, StopPoint};
use crate:... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | http::Request::builder()
.body(SdkBody::empty())
.expect("request is valid"),
)
}
fn new_response_deserializer() -> CannedResponseDeserializer {
CannedResponseDeserializer::new(
http::Response::builder()
.status(StatusCode::OK)
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | Err("FailingInterceptorA".into())
}
}
#[derive(Debug)]
struct FailingInterceptorB;
impl Interceptor for FailingInterceptorB {
fn $interceptor(&self, _ctx: $ctx, _cfg: &mut ConfigBag) -> Result<(), BoxError> {
tracing::d... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | let input = TypeErasedBox::new(Box::new(()));
let runtime_plugins = RuntimePlugins::new()
.with_client_plugin(FailingInterceptorsClientRuntimePlugin)
.with_operation_plugin(TestOperationRuntimePlugin)
.with_operation_plugin(AnonymousAuthRuntimePlugin::new())
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | read_after_attempt,
&FinalizerInterceptorContextRef<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_completion_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeCompletion... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | }
}
#[derive(Debug)]
struct DestinationInterceptor;
impl Interceptor for DestinationInterceptor {
fn $destination_interceptor(
&self,
_ctx: $destination_ctx,
_cfg: &mut ConfigBag,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | }
#[tokio::test]
#[traced_test]
async fn test_read_before_execution_error_causes_jump_to_modify_before_completion() {
let expected = r#""ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ModifyBeforeCompletion, source: Some(\"DestinationInterceptor\") } })""#.to_string();
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | #[tokio::test]
#[traced_test]
async fn test_read_after_serialization_error_causes_jump_to_modify_before_completion() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeCompletion, source: Some(\"DestinationInter... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | #[tokio::test]
#[traced_test]
async fn test_modify_before_signing_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"Dest... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | #[traced_test]
async fn test_modify_before_transmit_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"DestinationInterceptor... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 841 | 900 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:23 | async fn test_modify_before_deserialization_error_causes_jump_to_modify_before_attempt_completion(
) {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"DestinationInterceptor\") }, raw: Response { status: 200, version: HTTP/1.1, ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | #[tokio::test]
#[traced_test]
async fn test_modify_before_attempt_completion_error_causes_jump_to_read_after_attempt() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterAttempt, source: Some(\"DestinationInterceptor\") }, raw: Response { status: 200, version: H... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | // StopPoint::None should result in a response getting set since orchestration doesn't stop
let context = invoke_with_stop_point(
TypedBox::new(()).erase(),
&runtime_plugins(),
StopPoint::None,
)
.await
.expect("success");
assert!(context.respo... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 961 | 1,020 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | ) -> Result<(), BoxError> {
self.inner
.modify_before_retry_loop_called
.store(true, Ordering::Relaxed);
Err("test error".into())
}
fn modify_before_completion(
&self,
_context: &mut Finalize... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,001 | 1,060 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:27 | fn interceptors(&self, interceptors: &mut InterceptorRegistrar) {
interceptors.register(SharedInterceptor::new(self.interceptor.clone()));
}
}
let interceptor = TestInterceptor::default();
let runtime_plugins = || {
RuntimePlugins::new()
.... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9f74b5571f8f3376164e001f0f0bdc880ee329d1 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9f74b5571f8f3376164e001f0f0bdc880ee329d1/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,041 | 1,080 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use self::auth::orchestrate_auth;
use crate::client::orchestrator::endpoints::orchestrate_endpoint;
use crate::client::orchestrator::http::read_body;
use crate::client::timeout::{MaybeTimeout, ProvideMay... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:2 | ([$ctx:ident] => $expr:expr) => {
match $expr {
Ok(ok) => ok,
Err(err) => halt!([$ctx] => err),
}
};
}
macro_rules! continue_on_err {
([$ctx:ident] => $expr:expr) => {
if let Err(err) = $expr {
debug!("encountered orchestrator error; continuing");
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:3 | runtime_plugins: &RuntimePlugins,
stop_point: StopPoint,
) -> Result<InterceptorContext, SdkError<Error, HttpResponse>> {
let mut cfg = ConfigBag::base();
let cfg = &mut cfg;
let mut interceptors = Interceptors::new();
let mut ctx = InterceptorContext::new(input);
if let Err(err) = apply_confi... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | continue_on_err!([ctx] => interceptors.operation_read_before_execution(ctx, cfg));
Ok(())
}
#[instrument(skip_all)]
async fn try_op(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
interceptors: &Interceptors,
stop_point: StopPoint,
) {
// Before serialization
halt_on_err!([ctx] => inte... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | let retry_strategy = cfg.retry_strategy();
// If we got a retry strategy from the bag, ask it what to do.
// Otherwise, assume we should attempt the initial request.
let should_attempt = retry_strategy
.map(|rs| rs.should_attempt_initial_request(cfg))
.unwrap_or(Ok(ShouldAttempt::Yes));
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | }
.maybe_timeout_with_config(attempt_timeout_config)
.await
.map_err(|err| OrchestratorError::timeout(err.into_source().unwrap()));
// We continue when encountering a timeout error. The retry classifier will decide what to do with it.
continue_on_err!([ctx] => maybe_timeout);
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | cfg: &mut ConfigBag,
interceptors: &Interceptors,
stop_point: StopPoint,
) {
halt_on_err!([ctx] => interceptors.read_before_attempt(ctx, cfg));
halt_on_err!([ctx] => orchestrate_endpoint(ctx, cfg).map_err(OrchestratorError::other));
halt_on_err!([ctx] => interceptors.modify_before_signing(ctx, cfg))... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | let output_or_error = async {
let response = ctx.response_mut().expect("set during transmit");
let response_deserializer = cfg.response_deserializer();
match response_deserializer.deserialize_streaming(response) {
Some(output_or_error) => output_or_error,
None => read_bod... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | mod tests {
use super::invoke;
use crate::client::orchestrator::endpoints::{
StaticUriEndpointResolver, StaticUriEndpointResolverParams,
};
use crate::client::orchestrator::{invoke_with_stop_point, StopPoint};
use crate::client::retries::strategy::NeverRetryStrategy;
use crate::client::r... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | )
}
fn new_response_deserializer() -> CannedResponseDeserializer {
CannedResponseDeserializer::new(
http::Response::builder()
.status(StatusCode::OK)
.body(SdkBody::empty())
.map_err(|err| OrchestratorError::other(Box::new(err)))
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:3 | runtime_plugins: &RuntimePlugins,
stop_point: StopPoint,
) -> Result<InterceptorContext, SdkError<Error, HttpResponse>> {
let mut cfg = ConfigBag::base();
let cfg = &mut cfg;
let mut interceptors = Interceptors::new();
let mut ctx = InterceptorContext::new(input);
if let Err(err) = apply_confi... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | continue_on_err!([ctx] => interceptors.operation_read_before_execution(ctx, cfg));
Ok(())
}
#[instrument(skip_all)]
async fn try_op(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
interceptors: &Interceptors,
stop_point: StopPoint,
) {
// Before serialization
halt_on_err!([ctx] => inte... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | let retry_strategy = cfg.retry_strategy();
// If we got a retry strategy from the bag, ask it what to do.
// Otherwise, assume we should attempt the initial request.
let should_attempt = retry_strategy
.map(|rs| rs.should_attempt_initial_request(cfg))
.unwrap_or(Ok(ShouldAttempt::Yes));
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | .maybe_timeout_with_config(attempt_timeout_config)
.await
.map_err(OrchestratorError::other);
// We continue when encountering a timeout error. The retry classifier will decide what to do with it.
continue_on_err!([ctx] => maybe_timeout);
let retry_strategy = cfg.retry_strategy... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | ) {
halt_on_err!([ctx] => interceptors.read_before_attempt(ctx, cfg));
halt_on_err!([ctx] => orchestrate_endpoint(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_signing(ctx, cfg));
halt_on_err!([ctx] => interceptors.read_before_signing(ctx, cfg));
halt_on_err!([ctx] => orchestrate_aut... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | .map_err(OrchestratorError::other)
.and_then(|_| response_deserializer.deserialize_nonstreaming(response)),
}
}
.await;
ctx.set_output_or_error(output_or_error);
ctx.enter_after_deserialization_phase();
halt_on_err!([ctx] => interceptors.read_after_deserialization(ctx, cfg))... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | use crate::client::test_util::{
connector::OkConnector, deserializer::CannedResponseDeserializer,
serializer::CannedRequestSerializer,
};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::interceptors::context::wrappers::{
FinalizerInterceptorContextMut, Finaliz... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | .map_err(|err| OrchestratorError::other(Box::new(err)))
.map(|res| Output::new(Box::new(res))),
)
}
#[derive(Debug)]
struct TestOperationRuntimePlugin;
impl RuntimePlugin for TestOperationRuntimePlugin {
fn configure(
&self,
cfg: &mut ConfigBag,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | tracing::debug!("FailingInterceptorB called!");
Err("FailingInterceptorB".into())
}
}
#[derive(Debug)]
struct FailingInterceptorC;
impl Interceptor for FailingInterceptorC {
fn $interceptor(&self, _ctx: $ctx, _cfg: &mut... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | Ok(())
}
}
let input = TypeErasedBox::new(Box::new(()));
let runtime_plugins = RuntimePlugins::new()
.with_client_plugin(FailingInterceptorsClientRuntimePlugin)
.with_operation_plugin(TestOperationRuntimePlugin)
.with_o... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | #[traced_test]
async fn test_read_after_attempt_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterAttempt, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inner: Once(Some(b\"\")... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | _cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
tracing::debug!("OriginInterceptor called!");
Err("OriginInterceptor".into())
}
}
#[derive(Debug)]
struct DestinationInterceptor;
impl Interceptor fo... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | .with_operation_plugin(InterceptorsTestOperationRuntimePlugin);
let actual = invoke(input, &runtime_plugins)
.await
.expect_err("should error");
let actual = format!("{:?}", actual);
assert_eq!($expected, format!("{:?}", actual));
assert!(... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | async fn test_read_before_serialization_error_causes_jump_to_modify_before_completion() {
let expected = r#""ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ModifyBeforeCompletion, source: Some(\"DestinationInterceptor\") } })""#.to_string();
interceptor_error_redirection_test... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"DestinationInterceptor\") }, connection: Unknown } })""#.to_string();
interceptor_error_redirection_test!(
read_before_attem... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | interceptor_error_redirection_test!(
read_after_signing,
&BeforeTransmitInterceptorContextRef<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_mod... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 841 | 900 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:23 | read_after_transmit,
&BeforeDeserializationInterceptorContextRef<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_deserialization_error_causes_j... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"DestinationInterceptor\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inner: Once(Some(b\"\")), retryable: true } } })""#.to_string();
interceptor_e... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | }
#[tokio::test]
async fn test_stop_points() {
let runtime_plugins = || {
RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin)
.with_operation_plugin(AnonymousAuthRuntimePlugin)
};
// StopPoint::None should result in a res... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 961 | 1,020 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | #[derive(Clone, Debug, Default)]
struct TestInterceptor {
inner: Arc<Inner>,
}
impl Interceptor for TestInterceptor {
fn modify_before_retry_loop(
&self,
_context: &mut BeforeTransmitInterceptorContextMut<'_>,
_cfg: &mut Co... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,001 | 1,060 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:27 | #[derive(Debug)]
struct TestInterceptorRuntimePlugin {
interceptor: TestInterceptor,
}
impl RuntimePlugin for TestInterceptorRuntimePlugin {
fn configure(
&self,
cfg: &mut ConfigBag,
interceptors: &mut InterceptorRegistrar,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | cefbd78e81aa57ad9c583f3a8927d505d5d901e5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/cefbd78e81aa57ad9c583f3a8927d505d5d901e5/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,041 | 1,091 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use self::auth::orchestrate_auth;
use crate::client::orchestrator::endpoints::orchestrate_endpoint;
use crate::client::orchestrator::http::read_body;
use crate::client::timeout::{MaybeTimeout, ProvideMay... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:2 | ([$ctx:ident] => $expr:expr) => {
match $expr {
Ok(ok) => ok,
Err(err) => halt!([$ctx] => err),
}
};
}
macro_rules! continue_on_err {
([$ctx:ident] => $expr:expr) => {
if let Err(err) = $expr {
trace!("encountered orchestrator error, continuing");
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:3 | }
.maybe_timeout_with_config(operation_timeout_config)
.await
}
/// Apply configuration is responsible for apply runtime plugins to the config bag, as well as running
/// `read_before_execution` interceptors. If a failure occurs due to config construction, `invoke`
/// will raise it to the user. If an intercep... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | if let LoadedRequestBody::Requested = cfg.loaded_request_body() {
let mut body = SdkBody::taken();
let req = ctx.request_mut().expect("request exists");
mem::swap(&mut body, req.body_mut());
let loaded_body = halt_on_err!([ctx] => ByteStream::new(body).collect().await).into_bytes();
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | // Break from the loop if we can't rewind the request's state. This will always succeed the
// first time, but will fail on subsequent iterations if the request body wasn't retryable.
match ctx.rewind(cfg) {
r @ RewindResult::Impossible => {
debug!("{r}");
bre... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | }
ShouldAttempt::YesAfterDelay(delay) => {
let sleep_impl = halt_on_err!([ctx] => cfg.sleep_impl().ok_or(OrchestratorError::other(
"The retry strategy requested a delay before sending the next request, but no 'async sleep' implementation was set."
)));
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | halt_on_err!([ctx] => interceptors.modify_before_deserialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.read_before_deserialization(ctx, cfg));
ctx.enter_deserialization_phase();
let output_or_error = async {
let response = ctx
.response_mut()
.ok_or("No response was... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | ) {
continue_on_err!([ctx] => interceptors.modify_before_completion(ctx, cfg));
continue_on_err!([ctx] => interceptors.read_after_execution(ctx, cfg));
}
#[cfg(all(test, feature = "test-util", feature = "anonymous-auth"))]
mod tests {
use super::invoke;
use crate::client::orchestrator::endpoints::{
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | http::Request::builder()
.body(SdkBody::empty())
.expect("request is valid"),
)
}
fn new_response_deserializer() -> CannedResponseDeserializer {
CannedResponseDeserializer::new(
http::Response::builder()
.status(StatusCode::OK)
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | impl Interceptor for FailingInterceptorA {
fn $interceptor(&self, _ctx: $ctx, _cfg: &mut ConfigBag) -> Result<(), BoxError> {
tracing::debug!("FailingInterceptorA called!");
Err("FailingInterceptorA".into())
}
}
#[derive(De... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | #[derive(Debug)]
struct FailingInterceptorsOperationRuntimePlugin;
impl RuntimePlugin for FailingInterceptorsOperationRuntimePlugin {
fn configure(
&self,
_cfg: &mut ConfigBag,
interceptors: &mut InterceptorRegistrar,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | &BeforeSerializationInterceptorContextRef<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_serialization_error_handling() {
let expected = r#""ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ModifyBeforeSerialization, so... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | async fn test_modify_before_retry_loop_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeRetryLoop, source: Some(\"FailingInterceptorC\") }, connection: Unknown } })""#.to_string();
interceptor... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | }
#[tokio::test]
#[traced_test]
async fn test_read_after_signing_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadAfterSigning, source: Some(\"FailingInterceptorC\") }, connection: Unknown } })""... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | read_after_transmit,
&BeforeDeserializationInterceptorContextRef<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_deserialization_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: Modi... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:16 | #[traced_test]
async fn test_modify_before_attempt_completion_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBod... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | );
}
macro_rules! interceptor_error_redirection_test {
($origin_interceptor:ident, $origin_ctx:ty, $destination_interceptor:ident, $destination_ctx:ty, $expected:expr) => {
#[derive(Debug)]
struct OriginInterceptor;
impl Interceptor for OriginInterceptor {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | interceptors.register(SharedInterceptor::new(OriginInterceptor));
interceptors.register(SharedInterceptor::new(DestinationInterceptor));
Ok(())
}
}
let input = TypeErasedBox::new(Box::new(()));
let runtime_plugins = RuntimePlu... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | interceptor_error_redirection_test!(
modify_before_serialization,
&mut BeforeSerializationInterceptorContextMut<'_>,
modify_before_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async f... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | modify_before_retry_loop,
&mut BeforeTransmitInterceptorContextMut<'_>,
modify_before_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_attempt_error_causes_jump_to_modify_be... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | &BeforeTransmitInterceptorContextRef<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_signing_error_causes_jump_to_modify_before_attempt_completion() {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_transmit_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""ResponseError(ResponseError { sou... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 841 | 900 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:23 | &BeforeDeserializationInterceptorContextRef<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_deserialization_error_causes_jump_to_modify_before_attempt_complet... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 933 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | #[tokio::test]
#[traced_test]
async fn test_modify_before_completion_error_causes_jump_to_read_after_execution() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterExecution, source: Some(\"DestinationInterceptor\") }, raw: Response { status: 200, version: HTTP/... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 2fcec800932fc3e127633fde6c64b3a5852d36e3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/2fcec800932fc3e127633fde6c64b3a5852d36e3/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 933 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use self::auth::orchestrate_auth;
use crate::client::orchestrator::endpoints::orchestrate_endpoint;
use crate::client::orchestrator::http::read_body;
use crate::client::timeout::{MaybeTimeout, ProvideMay... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:2 | match $expr {
Ok(ok) => ok,
Err(err) => halt!([$ctx] => err),
}
};
}
macro_rules! continue_on_err {
([$ctx:ident] => $expr:expr) => {
if let Err(err) = $expr {
trace!("encountered orchestrator error, continuing");
$ctx.fail(err.into());
}
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:3 | .maybe_timeout_with_config(operation_timeout_config)
.await
}
/// Apply configuration is responsible for apply runtime plugins to the config bag, as well as running
/// `read_before_execution` interceptors. If a failure occurs due to config construction, `invoke`
/// will raise it to the user. If an interceptor fa... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | let mut body = SdkBody::taken();
let req = ctx.request_mut().expect("request exists");
mem::swap(&mut body, req.body_mut());
let loaded_body = halt_on_err!([ctx] => ByteStream::new(body).collect().await).into_bytes();
*req.body_mut() = SdkBody::from(loaded_body.clone());
cfg.set_... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | }
r @ RewindResult::Occurred => debug!("{r}"),
r @ RewindResult::Unnecessary => debug!("{r}"),
}
// Track which attempt we're currently on.
cfg.put::<RequestAttempts>(i.into());
let attempt_timeout_config = cfg.maybe_timeout_config(TimeoutKind::OperationAttempt);
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | #[instrument(skip_all)]
async fn try_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
interceptors: &Interceptors,
) {
halt_on_err!([ctx] => interceptors.read_before_attempt(ctx, cfg));
halt_on_err!([ctx] => orchestrate_endpoint(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_be... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | .instrument(debug_span!("read_body"))
.await
.map(|_| response_deserializer.deserialize_nonstreaming(response)),
}
}
.await
.expect("how should I insert this into the context?");
ctx.set_output_or_error(output_or_error);
ctx.enter_after_deserialization_phase(... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | use crate::client::runtime_plugin::anonymous_auth::AnonymousAuthRuntimePlugin;
use crate::client::test_util::{
connector::OkConnector, deserializer::CannedResponseDeserializer,
serializer::CannedRequestSerializer,
};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client:... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | .map(|res| Output::new(Box::new(res))),
)
}
#[derive(Debug)]
struct TestOperationRuntimePlugin;
impl RuntimePlugin for TestOperationRuntimePlugin {
fn configure(
&self,
cfg: &mut ConfigBag,
_interceptors: &mut InterceptorRegistrar,
) -> Resul... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | Err("FailingInterceptorB".into())
}
}
#[derive(Debug)]
struct FailingInterceptorC;
impl Interceptor for FailingInterceptorC {
fn $interceptor(&self, _ctx: $ctx, _cfg: &mut ConfigBag) -> Result<(), BoxError> {
tracing::d... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | Ok(())
}
}
let input = TypeErasedBox::new(Box::new(()));
let runtime_plugins = RuntimePlugins::new()
.with_client_plugin(FailingInterceptorsClientRuntimePlugin)
.with_operation_plugin(TestOperationRuntimePlugin)
.with_o... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_serialization_error_handling() {
let expected = r#""ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ReadBeforeSerialization, source: Some(\"FailingInterceptorC\") } })""#.to_string();
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadBeforeAttempt, source: Some(\"FailingInterceptorC\") }, connection: Unknown } })""#.to_string();
interceptor_error_handling_test!(
read_before_attempt,
&B... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | #[tokio::test]
#[traced_test]
async fn test_modify_before_transmit_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeTransmit, source: Some(\"FailingInterceptorC\") }, connection: Unknown } })"... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | &mut BeforeDeserializationInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_deserialization_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadBeforeDeserialization, source: ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.