Nisha Patel
If you want the NodeJS Error to propagate which it sounds like you do, then you need to rethrow the error after logging it.
Your .catch() handler in deletePayment() is "eating" or "handling" the error and thus the error does not propagate back to the caller. It logs it but does nothing else thus changing the rejection into a resolved promise. The caller thinks the operation succeeded.
But, this code is only logging some errors and is mixing await with .catch() which is generally not favored. If you want to log any errors in this function, I'd do it like this:
Answered by:> jfriend00
Credit:> StackOverflow
Blog Links:
>How do I customize controller actions in Laravel Jetstream?
>Run Laravel Project to Active Local Server
>How to show encrypted user id in URL in Laravel?
>How to fix Laravel LiveWire listener?