Get failed coupon/gift card in checkout UI extension

const applyDiscountCodeChange = useApplyDiscountCodeChange();
const applyGiftCardChange = useApplyGiftCardChange();

const listAppliedDiscountList = useDiscountCodes();
const listAppliedGiftCards = useAppliedGiftCards();

By using these hooks I can apply or remove coupons/gift cards and also able to get the list of applied gift cards(But this happens only for custom text box and custom button not with default text and button).

I requirement is that when ever user types anything in the Shopify default text of reduce(gift/copuon card) and clicks on apply then in the error condition I want to get the failed code because I want to call an API there.

I am also in need of getting the failed discount returned or the discount as the user is typing it like the userBillingAddress() hook.