#[non_exhaustive]pub struct CreateApplicationError {
pub kind: CreateApplicationErrorKind,
/* private fields */
}Expand description
Error type for the CreateApplication 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: CreateApplicationErrorKindKind of error that occurred.
Implementations§
source§impl CreateApplicationError
impl CreateApplicationError
sourcepub fn new(kind: CreateApplicationErrorKind, meta: Error) -> Self
pub fn new(kind: CreateApplicationErrorKind, meta: Error) -> Self
Creates a new CreateApplicationError.
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 CreateApplicationError::Unhandled variant from any error type.
Examples found in repository?
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
pub fn parse_create_application_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateApplicationOutput, crate::error::CreateApplicationError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateApplicationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateApplicationError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AuthorizationErrorException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::AuthorizationErrorException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::authorization_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_authorization_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"HomeRegionNotSetException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::HomeRegionNotSetException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::home_region_not_set_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_home_region_not_set_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::InvalidParameterException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValueException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServerInternalErrorException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::ServerInternalErrorException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::server_internal_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_server_internal_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateApplicationError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateApplicationError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
pub fn parse_create_application_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateApplicationOutput, crate::error::CreateApplicationError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateApplicationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateApplicationError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AuthorizationErrorException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::AuthorizationErrorException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::authorization_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_authorization_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"HomeRegionNotSetException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::HomeRegionNotSetException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::home_region_not_set_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_home_region_not_set_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::InvalidParameterException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValueException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServerInternalErrorException" => crate::error::CreateApplicationError {
meta: generic,
kind: crate::error::CreateApplicationErrorKind::ServerInternalErrorException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::server_internal_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_server_internal_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateApplicationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateApplicationError::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.
Returns true if the error kind is CreateApplicationErrorKind::AuthorizationErrorException.
sourcepub fn is_home_region_not_set_exception(&self) -> bool
pub fn is_home_region_not_set_exception(&self) -> bool
Returns true if the error kind is CreateApplicationErrorKind::HomeRegionNotSetException.
sourcepub fn is_invalid_parameter_exception(&self) -> bool
pub fn is_invalid_parameter_exception(&self) -> bool
Returns true if the error kind is CreateApplicationErrorKind::InvalidParameterException.
sourcepub fn is_invalid_parameter_value_exception(&self) -> bool
pub fn is_invalid_parameter_value_exception(&self) -> bool
Returns true if the error kind is CreateApplicationErrorKind::InvalidParameterValueException.
sourcepub fn is_server_internal_error_exception(&self) -> bool
pub fn is_server_internal_error_exception(&self) -> bool
Returns true if the error kind is CreateApplicationErrorKind::ServerInternalErrorException.