rust-payjoin
rust-payjoin copied to clipboard
Audit `SessionError`, `CreateRequestError`, and `EncapsulationError` internal variants
- process_response methods return inconsistent error types when POSTing vs. GETting, specifically: EncapsulationError vs. ResponseError for send and SessionError vs. Error for receive.
- There are four duplicated variants between InternalEncapsulationError and InternalSessionError.
- Also, EncapsulationError is a misnomer since it afaict it's exclusively raised when decapsulating responses.
- The Hpke variant has nothing to do with en/decapsulation.
Originally posted by @spacebear21 in https://github.com/payjoin/rust-payjoin/issues/660#issuecomment-2814308584
There are other variants that appear duplicated between InternalCreateRequestError and InternalSessionError (namely Expired, Hpke, OhttpEncapsulation and potentially Url/ParseUrl).