Struct aws_sdk_workdocs::error::DeleteDocumentError
source · #[non_exhaustive]pub struct DeleteDocumentError {
pub kind: DeleteDocumentErrorKind,
/* private fields */
}
Expand description
Error type for the DeleteDocument
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: DeleteDocumentErrorKind
Kind of error that occurred.
Implementations§
source§impl DeleteDocumentError
impl DeleteDocumentError
sourcepub fn new(kind: DeleteDocumentErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteDocumentErrorKind, meta: Error) -> Self
Creates a new DeleteDocumentError
.
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 DeleteDocumentError::Unhandled
variant from any error type.
Examples found in repository?
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799
pub fn parse_delete_document_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteDocumentOutput, crate::error::DeleteDocumentError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteDocumentError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteDocumentError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConcurrentModificationException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::ConcurrentModificationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::concurrent_modification_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_concurrent_modification_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ConflictingOperationException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::ConflictingOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::conflicting_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflicting_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"EntityNotExistsException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"FailedDependencyException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ProhibitedStateException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::ProhibitedStateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::prohibited_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_prohibited_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedOperationException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedResourceAccessException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteDocumentError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteDocumentError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799
pub fn parse_delete_document_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteDocumentOutput, crate::error::DeleteDocumentError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteDocumentError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteDocumentError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConcurrentModificationException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::ConcurrentModificationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::concurrent_modification_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_concurrent_modification_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ConflictingOperationException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::ConflictingOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::conflicting_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflicting_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"EntityNotExistsException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"FailedDependencyException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ProhibitedStateException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::ProhibitedStateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::prohibited_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_prohibited_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedOperationException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedResourceAccessException" => crate::error::DeleteDocumentError {
meta: generic,
kind: crate::error::DeleteDocumentErrorKind::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::DeleteDocumentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteDocumentError::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_concurrent_modification_exception(&self) -> bool
pub fn is_concurrent_modification_exception(&self) -> bool
Returns true
if the error kind is DeleteDocumentErrorKind::ConcurrentModificationException
.
sourcepub fn is_conflicting_operation_exception(&self) -> bool
pub fn is_conflicting_operation_exception(&self) -> bool
Returns true
if the error kind is DeleteDocumentErrorKind::ConflictingOperationException
.
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 DeleteDocumentErrorKind::EntityNotExistsException
.
sourcepub fn is_failed_dependency_exception(&self) -> bool
pub fn is_failed_dependency_exception(&self) -> bool
Returns true
if the error kind is DeleteDocumentErrorKind::FailedDependencyException
.
sourcepub fn is_prohibited_state_exception(&self) -> bool
pub fn is_prohibited_state_exception(&self) -> bool
Returns true
if the error kind is DeleteDocumentErrorKind::ProhibitedStateException
.
Returns true
if the error kind is DeleteDocumentErrorKind::ServiceUnavailableException
.
Returns true
if the error kind is DeleteDocumentErrorKind::UnauthorizedOperationException
.
Returns true
if the error kind is DeleteDocumentErrorKind::UnauthorizedResourceAccessException
.