Having enabled retries for my Cloud Function, I am wondering what all the cases are that it will retry.
This section seems contradictary to me. Hence, I assume that I do not understand it.
I thought that the following implies that the function that have "Retry on failure" enabled will also retry on fatal errors:
Cloud Functions does not understand a fatal error that shouldn't be retried
However, what is the point of catching errors and using Promise.reject in that case?
I tried to use Promise.reject to cancel retries of my Cloud Function, however, that does not happen.
return Promise.reject(..) // will retry
throw Error() // will retry
Both will retry for a week if the function is not redeployed.
To me it seems like fatal errors and Promise.reject will both retry, however, the documentation says:
you should modify your code accordingly if you support fatal errors
What is the point of this section in the documentation and what should I really do now?