try { //işlemlerin } catch(Exception hata) { //hata oluştu //insert edeceksin "hata.Message" şeklinde ise hata mesajını alabilirsin. }