#[non_exhaustive]pub struct AssociateWebsiteAuthorizationProviderError {
pub kind: AssociateWebsiteAuthorizationProviderErrorKind,
/* private fields */
}Expand description
Error type for the AssociateWebsiteAuthorizationProvider 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: AssociateWebsiteAuthorizationProviderErrorKindKind of error that occurred.
Implementations§
source§impl AssociateWebsiteAuthorizationProviderError
impl AssociateWebsiteAuthorizationProviderError
sourcepub fn new(
kind: AssociateWebsiteAuthorizationProviderErrorKind,
meta: Error
) -> Self
pub fn new(
kind: AssociateWebsiteAuthorizationProviderErrorKind,
meta: Error
) -> Self
Creates a new AssociateWebsiteAuthorizationProviderError.
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 AssociateWebsiteAuthorizationProviderError::Unhandled variant from any error type.
Examples found in repository?
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
pub fn parse_associate_website_authorization_provider_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AssociateWebsiteAuthorizationProviderOutput,
crate::error::AssociateWebsiteAuthorizationProviderError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::AssociateWebsiteAuthorizationProviderError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerErrorException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::InternalServerErrorException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::InvalidRequestException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceAlreadyExistsException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::ResourceAlreadyExistsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_already_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_already_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"TooManyRequestsException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::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::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnauthorizedException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::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::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::AssociateWebsiteAuthorizationProviderError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the AssociateWebsiteAuthorizationProviderError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
pub fn parse_associate_website_authorization_provider_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AssociateWebsiteAuthorizationProviderOutput,
crate::error::AssociateWebsiteAuthorizationProviderError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::AssociateWebsiteAuthorizationProviderError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerErrorException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::InternalServerErrorException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::InvalidRequestException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceAlreadyExistsException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::ResourceAlreadyExistsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_already_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_already_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"TooManyRequestsException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::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::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnauthorizedException" => crate::error::AssociateWebsiteAuthorizationProviderError { meta: generic, kind: crate::error::AssociateWebsiteAuthorizationProviderErrorKind::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::AssociateWebsiteAuthorizationProviderError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::AssociateWebsiteAuthorizationProviderError::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_internal_server_error_exception(&self) -> bool
pub fn is_internal_server_error_exception(&self) -> bool
Returns true if the error kind is AssociateWebsiteAuthorizationProviderErrorKind::InternalServerErrorException.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true if the error kind is AssociateWebsiteAuthorizationProviderErrorKind::InvalidRequestException.
sourcepub fn is_resource_already_exists_exception(&self) -> bool
pub fn is_resource_already_exists_exception(&self) -> bool
Returns true if the error kind is AssociateWebsiteAuthorizationProviderErrorKind::ResourceAlreadyExistsException.
sourcepub fn is_resource_not_found_exception(&self) -> bool
pub fn is_resource_not_found_exception(&self) -> bool
Returns true if the error kind is AssociateWebsiteAuthorizationProviderErrorKind::ResourceNotFoundException.
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 AssociateWebsiteAuthorizationProviderErrorKind::TooManyRequestsException.
Returns true if the error kind is AssociateWebsiteAuthorizationProviderErrorKind::UnauthorizedException.