@Anonymous
You might consider the approach of not letting a user submit if there is a duplicate, rather than trying to catch the error and handle it (as error handling is a bit tricky in PowerApps).
Set your DisplayMode of your submit button to something similar to this:
If(
!IsBlank(
LookUp(YourDataSource, yourUniqueField = theControlWhereSomeoneWouldEnterTheValue.Text, ID)
),
Disabled,
Edit
)
This will lookup the unique value - if there is a record with it, then the button will be disabled.
You could use this same logic on the visible property of a Label that might display "please enter a unique value".
I hope this is helpful for you.