Struct aws_sdk_apigateway::error::GetExportError
source · #[non_exhaustive]pub struct GetExportError {
pub kind: GetExportErrorKind,
/* private fields */
}
Expand description
Error type for the GetExport
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: GetExportErrorKind
Kind of error that occurred.
Implementations§
source§impl GetExportError
impl GetExportError
sourcepub fn new(kind: GetExportErrorKind, meta: Error) -> Self
pub fn new(kind: GetExportErrorKind, meta: Error) -> Self
Creates a new GetExportError
.
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 GetExportError::Unhandled
variant from any error type.
Examples found in repository?
7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318
pub fn parse_get_export_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetExportOutput, crate::error::GetExportError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetExportError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetExportError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"BadRequestException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::BadRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::bad_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_bad_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetExportError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ConflictException" => {
crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::ConflictException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::conflict_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetExportError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"LimitExceededException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::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::GetExportError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_export_limit_exceeded_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetExportError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::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::GetExportError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyRequestsException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::TooManyRequestsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetExportError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_export_too_many_requests_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetExportError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetExportError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetExportError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_export_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetExportOutput, crate::error::GetExportError> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::get_export_output::Builder::default();
let _ = response;
output = output.set_body(
crate::http_serde::deser_payload_get_export_get_export_output_body(
response.body().as_ref(),
)?,
);
output = output.set_content_disposition(
crate::http_serde::deser_header_get_export_get_export_output_content_disposition(
response.headers(),
)
.map_err(|_| {
crate::error::GetExportError::unhandled(
"Failed to parse contentDisposition from header `Content-Disposition",
)
})?,
);
output = output.set_content_type(
crate::http_serde::deser_header_get_export_get_export_output_content_type(
response.headers(),
)
.map_err(|_| {
crate::error::GetExportError::unhandled(
"Failed to parse contentType from header `Content-Type",
)
})?,
);
output.build()
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetExportError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281
pub fn parse_get_export_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetExportOutput, crate::error::GetExportError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetExportError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetExportError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"BadRequestException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::BadRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::bad_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_bad_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetExportError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ConflictException" => {
crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::ConflictException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::conflict_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetExportError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"LimitExceededException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::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::GetExportError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_export_limit_exceeded_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetExportError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::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::GetExportError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyRequestsException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::TooManyRequestsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetExportError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_export_too_many_requests_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetExportError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::GetExportError {
meta: generic,
kind: crate::error::GetExportErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetExportError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetExportError::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_bad_request_exception(&self) -> bool
pub fn is_bad_request_exception(&self) -> bool
Returns true
if the error kind is GetExportErrorKind::BadRequestException
.
sourcepub fn is_conflict_exception(&self) -> bool
pub fn is_conflict_exception(&self) -> bool
Returns true
if the error kind is GetExportErrorKind::ConflictException
.
sourcepub fn is_limit_exceeded_exception(&self) -> bool
pub fn is_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is GetExportErrorKind::LimitExceededException
.
sourcepub fn is_not_found_exception(&self) -> bool
pub fn is_not_found_exception(&self) -> bool
Returns true
if the error kind is GetExportErrorKind::NotFoundException
.
sourcepub fn is_too_many_requests_exception(&self) -> bool
pub fn is_too_many_requests_exception(&self) -> bool
Returns true
if the error kind is GetExportErrorKind::TooManyRequestsException
.
Returns true
if the error kind is GetExportErrorKind::UnauthorizedException
.