我這是怎麼翻譯引發的錯誤:這是一個足夠好的系統錯誤對用戶友好錯誤翻譯器嗎?
catch (NpgsqlException ex)
{
if (tx != null) tx.Rollback();
if (ex.Message.Contains("foreign key constraint"))
throw new Exception("Cannot delete this, this record is already referenced on other record(s)");
else
throw new Exception(ex.Message, ex.InnerException);
}
樣品Npgsql的約束錯誤:
ERROR: 23503: update or delete on table "color" violates foreign key constraint "fk_order_detail__color" on table "order_detail"
+1程序質量可以從其錯誤處理來判斷。對你有好處,試圖改善你的錯誤處理! – scraimer 2009-06-18 08:40:42