1#[derive(::std::clone::Clone, ::std::fmt::Debug, ::std::cmp::PartialEq)]
5pub enum Error {
6 #[allow(missing_docs)]
7 AwsEncryptionSdkException {
8 message: ::std::string::String,
9 },
10
11 AwsCryptographicPrimitivesError {
12 error: crate::deps::aws_cryptography_primitives::types::error::Error,
13 },
14
15 AwsCryptographicMaterialProvidersError {
16 error: crate::deps::aws_cryptography_materialProviders::types::error::Error,
17 },
18 CollectionOfErrors {
19 list: ::std::vec::Vec<Self>,
20 message: ::std::string::String,
21 },
22 ValidationError(ValidationError),
23 Opaque {
24 obj: ::dafny_runtime::Object<::dafny_runtime::DynAny>,
25 },
26 OpaqueWithText {
27 obj: ::dafny_runtime::Object<::dafny_runtime::DynAny>,
28 objMessage: ::std::string::String,
29 },
30}
31
32impl ::std::cmp::Eq for Error {}
33
34impl ::std::fmt::Display for Error {
35 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
36 match self {
37 Self::ValidationError(err) => ::std::fmt::Display::fmt(err, f),
38 _ => ::std::fmt::Debug::fmt(self, f),
39 }
40 }
41}
42
43impl ::std::error::Error for Error {
44 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
45 match self {
46 Self::ValidationError(err) => Some(err),
47 _ => None,
48 }
49 }
50}
51
52impl Error {
53 pub fn wrap_validation_err<E>(err: E) -> Self
54 where
55 E: ::std::error::Error + Send + Sync + 'static,
56 {
57 Self::ValidationError(ValidationError(::dafny_runtime::Rc::new(err)))
58 }
59}
60
61#[derive(::std::clone::Clone, ::std::fmt::Debug)]
62pub struct ValidationError(::dafny_runtime::Rc<dyn ::std::error::Error + Send + Sync>);
63
64impl ::std::cmp::PartialEq for ValidationError {
65 fn eq(&self, other: &Self) -> bool {
66 ::dafny_runtime::Rc::<(dyn std::error::Error + Send + Sync + 'static)>::ptr_eq(
67 &self.0, &other.0,
68 )
69 }
70}
71
72impl ::std::fmt::Display for ValidationError {
73 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
74 ::std::fmt::Display::fmt(&self.0, f)
75 }
76}
77
78impl ::std::error::Error for ValidationError {
79 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
80 ::std::option::Option::Some(self.0.as_ref())
81 }
82}