Browse Source

异常处理

CrazyIter 4 years ago
parent
commit
80a50a7a11
1 changed files with 6 additions and 1 deletions
  1. 6 1
      TEAMModelOS.SDK/DI/AzureCosmos/AzureCosmosFactory.cs

+ 6 - 1
TEAMModelOS.SDK/DI/AzureCosmos/AzureCosmosFactory.cs

@@ -114,7 +114,12 @@ namespace TEAMModelOS.SDK.DI
             }
             }
             //获取数据库所有的表
             //获取数据库所有的表
             // List<Type> types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(BaseConfigModel.Configuration.GetSection("Azure:Cosmos:ScanModel").Get<string[]>() );
             // List<Type> types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(BaseConfigModel.Configuration.GetSection("Azure:Cosmos:ScanModel").Get<string[]>() );
-            List<Type> types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(_optionsMonitor.Get("Default").ScanModel);
+            List<Type> types = new List<Type>() ;
+            try {
+                types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(_optionsMonitor.Get("Default").ScanModel);
+            } catch(Exception e) {
+                Console.WriteLine(e.StackTrace);
+            }
             foreach (Type type in types)
             foreach (Type type in types)
             {
             {
                 string PartitionKey = AzureCosmosUtil.GetPartitionKey(type);
                 string PartitionKey = AzureCosmosUtil.GetPartitionKey(type);