It would be great to have dedicated exceptions for various failure scenarios. Now there is only DecodingFailedException. Other failure scenarios that could use their own exception class:
SignatureValidationFailedException - the signature is not valid or was not created using Apple's private key
PaymentDataExpiredException - the payment data has expired
DecryptingFailureException - the data cannot be decrypted using the private key provided.
Now, we have to resort to substring matching on the exception message.
It would be great to have dedicated exceptions for various failure scenarios. Now there is only
DecodingFailedException
. Other failure scenarios that could use their own exception class:SignatureValidationFailedException
- the signature is not valid or was not created using Apple's private keyPaymentDataExpiredException
- the payment data has expiredDecryptingFailureException
- the data cannot be decrypted using the private key provided.Now, we have to resort to substring matching on the exception message.