There is no way to distinguish between cancellation and other type of failures.
However, per Amazon IAP UX guidelines:
Your app should not attempt to message any transaction state or status to the customer. In-App Purchasing API will handle all confirmations and messaging to the customer, including transaction success and failure messages.