That would be something you would do on the client side... What client-side interaction is occurring?
Perhaps you want SQL to raise an error and pass a message back to your code. In that case, have a look at the RAISERROR (i don't think there's a double 'E') TSQL command.