1
試圖通過無效數據庫連接來測試未連接到數據庫的錯誤條件。當我運行我的應用程序,我在IDE中得到這個如果數據庫連接字符串無效,則處理異常
Exception in thread "main" play.exceptions.DatabaseException: Cannot connected to the database, Communications link failure
我有以下
@Before
static void initFromDB()
{
try{
//Get some values from DB
}catch (Exception ex)
{
Logger.fatal(ex.toString(), new Object());
error("Database issue");
}
}
如果我在IE啓動我的網站,然後我得到
Internet Explorer cannot display the webpage
我不明白500頁。
我在DEV
模式下運行與playframework 1.2.4
在PROD
,因爲它不能在PROD模式的錯誤開始,我不會讓錯誤頁面,或因此說,在我的IDE
UPDATE消息1 : 我確保我所有的數據庫連接都是有效的。切換到prod
模式。開始了我的網站,而網站是加載,我從網絡上斷開,我也得到一個一般性錯誤消息
Oops, an error occured