1
時訪問DB執行錯誤這裏的片段(這裏是mysql的MySQL for Swift一個實例):如何使用MySQL的雨燕
do {
try mysql.execute("INSERT INTO ...")
} catch {
print(error) // here will print out the actual MySQL error message
return error.localizedDescription // return "The operation couldn’t be completed. (MySQL.Error error 6.)" The real message from the DB is lost.
}
在閉鎖段一號線,print語句能吐從DB發出真正的錯誤消息,但第二行僅返回一條通用語句: The operation couldn’t be completed. (MySQL.Error error 6.)
如何從數據庫訪問下劃線錯誤消息?