@@ -4,9 +4,6 @@ use bitcoin::locktime::absolute::LockTime;
4
4
use bitcoin:: transaction:: Version ;
5
5
use bitcoin:: { AddressType , Sequence } ;
6
6
7
- #[ cfg( feature = "v2" ) ]
8
- use crate :: uri:: url_ext:: ParseReceiverPubkeyParamError ;
9
-
10
7
/// Error building a Sender from a SenderBuilder.
11
8
///
12
9
/// This error is unrecoverable.
@@ -84,71 +81,6 @@ impl std::error::Error for BuildSenderError {
84
81
}
85
82
}
86
83
87
- /// Error returned when request could not be created.
88
- ///
89
- /// This error can currently only happen due to programmer mistake.
90
- /// `unwrap()`ing it is thus considered OK in Rust but you may achieve nicer message by displaying
91
- /// it.
92
- #[ derive( Debug ) ]
93
- #[ cfg( feature = "v2" ) ]
94
- pub struct CreateRequestError ( InternalCreateRequestError ) ;
95
-
96
- #[ derive( Debug ) ]
97
- #[ cfg( feature = "v2" ) ]
98
- pub ( crate ) enum InternalCreateRequestError {
99
- Url ( url:: ParseError ) ,
100
- Hpke ( crate :: hpke:: HpkeError ) ,
101
- OhttpEncapsulation ( crate :: ohttp:: OhttpEncapsulationError ) ,
102
- ParseReceiverPubkey ( ParseReceiverPubkeyParamError ) ,
103
- MissingOhttpConfig ,
104
- Expired ( std:: time:: SystemTime ) ,
105
- }
106
-
107
- #[ cfg( feature = "v2" ) ]
108
- impl fmt:: Display for CreateRequestError {
109
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
110
- use InternalCreateRequestError :: * ;
111
-
112
- match & self . 0 {
113
- Url ( e) => write ! ( f, "cannot parse url: {:#?}" , e) ,
114
- Hpke ( e) => write ! ( f, "v2 error: {}" , e) ,
115
- OhttpEncapsulation ( e) => write ! ( f, "v2 error: {}" , e) ,
116
- ParseReceiverPubkey ( e) => write ! ( f, "cannot parse receiver public key: {}" , e) ,
117
- MissingOhttpConfig =>
118
- write ! ( f, "no ohttp configuration with which to make a v2 request available" ) ,
119
- Expired ( expiry) => write ! ( f, "session expired at {:?}" , expiry) ,
120
- }
121
- }
122
- }
123
-
124
- #[ cfg( feature = "v2" ) ]
125
- impl std:: error:: Error for CreateRequestError {
126
- fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
127
- use InternalCreateRequestError :: * ;
128
-
129
- match & self . 0 {
130
- Url ( error) => Some ( error) ,
131
- Hpke ( error) => Some ( error) ,
132
- OhttpEncapsulation ( error) => Some ( error) ,
133
- ParseReceiverPubkey ( error) => Some ( error) ,
134
- MissingOhttpConfig => None ,
135
- Expired ( _) => None ,
136
- }
137
- }
138
- }
139
-
140
- #[ cfg( feature = "v2" ) ]
141
- impl From < InternalCreateRequestError > for CreateRequestError {
142
- fn from ( value : InternalCreateRequestError ) -> Self { CreateRequestError ( value) }
143
- }
144
-
145
- #[ cfg( feature = "v2" ) ]
146
- impl From < ParseReceiverPubkeyParamError > for CreateRequestError {
147
- fn from ( value : ParseReceiverPubkeyParamError ) -> Self {
148
- CreateRequestError ( InternalCreateRequestError :: ParseReceiverPubkey ( value) )
149
- }
150
- }
151
-
152
84
/// Error that may occur when the response from receiver is malformed.
153
85
///
154
86
/// This is currently opaque type because we aren't sure which variants will stay.
0 commit comments