File tree 4 files changed +16
-4
lines changed
4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1403,7 +1403,10 @@ impl LengthReadable for Bolt12Invoice {
1403
1403
reader : & mut R ,
1404
1404
) -> Result < Self , DecodeError > {
1405
1405
let bytes: WithoutLength < Vec < u8 > > = LengthReadable :: read_from_fixed_length_buffer ( reader) ?;
1406
- Self :: try_from ( bytes. 0 ) . map_err ( |_| DecodeError :: InvalidValue )
1406
+ Self :: try_from ( bytes. 0 ) . map_err ( |e| match e {
1407
+ Bolt12ParseError :: Decode ( e) => e,
1408
+ _ => DecodeError :: InvalidValue ,
1409
+ } )
1407
1410
}
1408
1411
}
1409
1412
Original file line number Diff line number Diff line change @@ -1123,7 +1123,10 @@ impl Writeable for InvoiceRequestContents {
1123
1123
impl LengthReadable for InvoiceRequest {
1124
1124
fn read_from_fixed_length_buffer < R : LengthLimitedRead > ( r : & mut R ) -> Result < Self , DecodeError > {
1125
1125
let bytes: WithoutLength < Vec < u8 > > = LengthReadable :: read_from_fixed_length_buffer ( r) ?;
1126
- Self :: try_from ( bytes. 0 ) . map_err ( |_| DecodeError :: InvalidValue )
1126
+ Self :: try_from ( bytes. 0 ) . map_err ( |e| match e {
1127
+ Bolt12ParseError :: Decode ( e) => e,
1128
+ _ => DecodeError :: InvalidValue ,
1129
+ } )
1127
1130
}
1128
1131
}
1129
1132
Original file line number Diff line number Diff line change @@ -1039,7 +1039,10 @@ impl LengthReadable for Offer {
1039
1039
reader : & mut R ,
1040
1040
) -> Result < Self , DecodeError > {
1041
1041
let bytes: WithoutLength < Vec < u8 > > = LengthReadable :: read_from_fixed_length_buffer ( reader) ?;
1042
- Self :: try_from ( bytes. 0 ) . map_err ( |_| DecodeError :: InvalidValue )
1042
+ Self :: try_from ( bytes. 0 ) . map_err ( |e| match e {
1043
+ Bolt12ParseError :: Decode ( e) => e,
1044
+ _ => DecodeError :: InvalidValue ,
1045
+ } )
1043
1046
}
1044
1047
}
1045
1048
Original file line number Diff line number Diff line change @@ -829,7 +829,10 @@ impl LengthReadable for Refund {
829
829
reader : & mut R ,
830
830
) -> Result < Self , DecodeError > {
831
831
let bytes: WithoutLength < Vec < u8 > > = LengthReadable :: read_from_fixed_length_buffer ( reader) ?;
832
- Self :: try_from ( bytes. 0 ) . map_err ( |_| DecodeError :: InvalidValue )
832
+ Self :: try_from ( bytes. 0 ) . map_err ( |e| match e {
833
+ Bolt12ParseError :: Decode ( e) => e,
834
+ _ => DecodeError :: InvalidValue ,
835
+ } )
833
836
}
834
837
}
835
838
You can’t perform that action at this time.
0 commit comments