rust-payjoin icon indicating copy to clipboard operation
rust-payjoin copied to clipboard

Audit `SessionError`, `CreateRequestError`, and `EncapsulationError` internal variants

Open spacebear21 opened this issue 7 months ago • 0 comments

  • 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).

spacebear21 avatar Jun 06 '25 18:06 spacebear21