If you don't want the system error to be raised at all, you may consider issuing an IF EXISTS() statement before the INSERT. If that's not an option, you can examine the return value of the function error and send your own user friendly error, but this won't prevent the original error message from being generated.
Another option that you may want to consider is using an instead of trigger, and within it check for existence of the new row. This would prevent the row from being inserted at all, as you control what gets inserted into the table and what's not.

--
BG, SQL Server MVP
Solid Quality Learning
[url]www.solidqualitylearning.com[/url]


"Ioannis Demetriades" <idemetriadesyahoo.co.uk> wrote in message news:emmEZBFRDHA.2036TK2MSFTNGP12.phx.gbl...
> Hi,
>
> How can i trap and process an error message that is raised due to a unique
> index from within a stored procedure? My aim is to send a user-friendly
> message to the caller and not the database error message.
>
> Thanks
> Ioannis
>
>