can i handle UK errors in aspx?
<p>Server Error in '/' Application.
Cannot insert duplicate key row in object 'dbo.Articles' with unique index 'UK_Articles'.
The statement has been terminated.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>

<p>Exception Details: System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.Articles' with unique index 'UK_Articles'.
The statement has been terminated.</p>

<p>can i instead of internal server error 500 show UK error? can i catch the error and show it somehow?</p>

<p>EDIT:</p>

<pre><code> try
        {
            NHibernateSession.Save(entity);
        }

        catch (SqlException sex )
        {
            if (sex.Message.Contains("with unique index"))
                throw new UniqueConstraintException("UK ERROR");

            throw;
        }
</code></pre>

<p>but NHibernateSession.Save(entity) always trow GenericADOException and never SqlException. I want to catch insert at nhibernate so that i can ctach it globally.</p>
