mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 18:48:09 +08:00
Optimized error prompts
This commit is contained in:
@@ -41,7 +41,7 @@ namespace OrmTest
|
|||||||
/// Database connection string
|
/// Database connection string
|
||||||
/// 数据库连接字符串
|
/// 数据库连接字符串
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static string Connection = "server=.;uid=sa;pwd=sasa;database=SqlSugar5Demo";
|
public readonly static string Connection = "server=.;uid=sa;pwd=sasa;database=SqlSugar5Demo;Encrypt=True;TrustServerCertificate=True";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a new SqlSugarClient instance with specific configurations
|
/// Get a new SqlSugarClient instance with specific configurations
|
||||||
|
@@ -183,6 +183,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
if (this.Context.CurrentConnectionConfig?.DbType==DbType.SqlServer&&ex.Message?.Contains("provider: SSL")==true)
|
||||||
|
{
|
||||||
|
Check.ExceptionEasy(true,ex.Message, "SSL出错,因为升级了驱动,字符串增加Encrypt=True;TrustServerCertificate=True;即可。详细错误:" + ex.Message);
|
||||||
|
}
|
||||||
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message+$"DbType=\"{this.Context.CurrentConnectionConfig.DbType}\";ConfigId=\"{this.Context.CurrentConnectionConfig.ConfigId}\"");
|
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message+$"DbType=\"{this.Context.CurrentConnectionConfig.DbType}\";ConfigId=\"{this.Context.CurrentConnectionConfig.ConfigId}\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user