Report question

Question: How can I know if an SQLexception was thrown because of foreign key violation?