Struct aws_sdk_workdocs::error::ActivateUserError
source · #[non_exhaustive]pub struct ActivateUserError {
pub kind: ActivateUserErrorKind,
/* private fields */
}
Expand description
Error type for the ActivateUser
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: ActivateUserErrorKind
Kind of error that occurred.
Implementations§
source§impl ActivateUserError
impl ActivateUserError
sourcepub fn new(kind: ActivateUserErrorKind, meta: Error) -> Self
pub fn new(kind: ActivateUserErrorKind, meta: Error) -> Self
Creates a new ActivateUserError
.
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 ActivateUserError::Unhandled
variant from any error type.
Examples found in repository?
126 127 128 129 130 131 132 133 134 135 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
pub fn parse_activate_user_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ActivateUserOutput, crate::error::ActivateUserError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ActivateUserError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ActivateUserError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"EntityNotExistsException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::EntityNotExistsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::entity_not_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_entity_not_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"FailedDependencyException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::FailedDependencyException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::failed_dependency_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_failed_dependency_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedOperationException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::UnauthorizedOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unauthorized_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedResourceAccessException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::UnauthorizedResourceAccessException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unauthorized_resource_access_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_resource_access_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ActivateUserError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ActivateUserError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
126 127 128 129 130 131 132 133 134 135 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
pub fn parse_activate_user_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ActivateUserOutput, crate::error::ActivateUserError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ActivateUserError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ActivateUserError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"EntityNotExistsException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::EntityNotExistsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::entity_not_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_entity_not_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"FailedDependencyException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::FailedDependencyException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::failed_dependency_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_failed_dependency_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedOperationException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::UnauthorizedOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unauthorized_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedResourceAccessException" => crate::error::ActivateUserError {
meta: generic,
kind: crate::error::ActivateUserErrorKind::UnauthorizedResourceAccessException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unauthorized_resource_access_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_resource_access_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ActivateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ActivateUserError::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_entity_not_exists_exception(&self) -> bool
pub fn is_entity_not_exists_exception(&self) -> bool
Returns true
if the error kind is ActivateUserErrorKind::EntityNotExistsException
.
sourcepub fn is_failed_dependency_exception(&self) -> bool
pub fn is_failed_dependency_exception(&self) -> bool
Returns true
if the error kind is ActivateUserErrorKind::FailedDependencyException
.
Returns true
if the error kind is ActivateUserErrorKind::ServiceUnavailableException
.
Returns true
if the error kind is ActivateUserErrorKind::UnauthorizedOperationException
.
Returns true
if the error kind is ActivateUserErrorKind::UnauthorizedResourceAccessException
.