Power Apps Error Handling in PowerFX with Patch function

Here is the code. Hope this helps.