Two options I can think of are:
- Forking the users-permissions plugin and making your desired changes in your clone.
- In your extension code, add a middleware to the relevant route and capture the error you want to modify.
Two options I can think of are: