#[non_exhaustive]pub struct ListRemoteAccessSessionsError {
pub kind: ListRemoteAccessSessionsErrorKind,
/* private fields */
}Expand description
Error type for the ListRemoteAccessSessions operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: ListRemoteAccessSessionsErrorKindKind of error that occurred.
Implementations§
source§impl ListRemoteAccessSessionsError
impl ListRemoteAccessSessionsError
sourcepub fn new(kind: ListRemoteAccessSessionsErrorKind, meta: Error) -> Self
pub fn new(kind: ListRemoteAccessSessionsErrorKind, meta: Error) -> Self
Creates a new ListRemoteAccessSessionsError.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the ListRemoteAccessSessionsError::Unhandled variant from any error type.
Examples found in repository?
5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211
pub fn parse_list_remote_access_sessions_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListRemoteAccessSessionsOutput,
crate::error::ListRemoteAccessSessionsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListRemoteAccessSessionsError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ArgumentException" => {
crate::error::ListRemoteAccessSessionsError {
meta: generic,
kind: crate::error::ListRemoteAccessSessionsErrorKind::ArgumentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::argument_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_argument_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"LimitExceededException" => crate::error::ListRemoteAccessSessionsError {
meta: generic,
kind: crate::error::ListRemoteAccessSessionsErrorKind::LimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::ListRemoteAccessSessionsError {
meta: generic,
kind: crate::error::ListRemoteAccessSessionsErrorKind::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceAccountException" => crate::error::ListRemoteAccessSessionsError {
meta: generic,
kind: crate::error::ListRemoteAccessSessionsErrorKind::ServiceAccountException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::service_account_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_account_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListRemoteAccessSessionsError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListRemoteAccessSessionsError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211
pub fn parse_list_remote_access_sessions_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListRemoteAccessSessionsOutput,
crate::error::ListRemoteAccessSessionsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListRemoteAccessSessionsError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ArgumentException" => {
crate::error::ListRemoteAccessSessionsError {
meta: generic,
kind: crate::error::ListRemoteAccessSessionsErrorKind::ArgumentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::argument_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_argument_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"LimitExceededException" => crate::error::ListRemoteAccessSessionsError {
meta: generic,
kind: crate::error::ListRemoteAccessSessionsErrorKind::LimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::ListRemoteAccessSessionsError {
meta: generic,
kind: crate::error::ListRemoteAccessSessionsErrorKind::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceAccountException" => crate::error::ListRemoteAccessSessionsError {
meta: generic,
kind: crate::error::ListRemoteAccessSessionsErrorKind::ServiceAccountException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::service_account_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_account_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListRemoteAccessSessionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListRemoteAccessSessionsError::generic(generic),
})
}sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_argument_exception(&self) -> bool
pub fn is_argument_exception(&self) -> bool
Returns true if the error kind is ListRemoteAccessSessionsErrorKind::ArgumentException.
sourcepub fn is_limit_exceeded_exception(&self) -> bool
pub fn is_limit_exceeded_exception(&self) -> bool
Returns true if the error kind is ListRemoteAccessSessionsErrorKind::LimitExceededException.
sourcepub fn is_not_found_exception(&self) -> bool
pub fn is_not_found_exception(&self) -> bool
Returns true if the error kind is ListRemoteAccessSessionsErrorKind::NotFoundException.
sourcepub fn is_service_account_exception(&self) -> bool
pub fn is_service_account_exception(&self) -> bool
Returns true if the error kind is ListRemoteAccessSessionsErrorKind::ServiceAccountException.