@@ -193,7 +193,7 @@ public void Tag(string tag, params string[] service)
193193 /// </summary>
194194 /// <param name="tag">标记名</param>
195195 /// <returns>将会返回标记所对应的所有服务实例</returns>
196- /// <exception cref="RuntimeException "><paramref name="tag"/>不存在</exception>
196+ /// <exception cref="LogicException "><paramref name="tag"/>不存在</exception>
197197 /// <exception cref="ArgumentNullException"><paramref name="tag"/>为<c>null</c>或者空字符串</exception>
198198 public object [ ] Tagged ( string tag )
199199 {
@@ -202,7 +202,7 @@ public object[] Tagged(string tag)
202202 {
203203 if ( ! tags . TryGetValue ( tag , out List < string > services ) )
204204 {
205- throw new RuntimeException ( $ "Tag [{ tag } ] is not exist.") ;
205+ throw new LogicException ( $ "Tag [{ tag } ] is not exist.") ;
206206 }
207207
208208 var result = new object [ services . Count ] ;
@@ -321,7 +321,7 @@ public bool IsAlias(string name)
321321 /// <param name="alias">别名</param>
322322 /// <param name="service">映射到的服务名</param>
323323 /// <returns>当前容器对象</returns>
324- /// <exception cref="RuntimeException "><paramref name="alias"/>别名冲突或者<paramref name="service"/>的绑定与实例都不存在</exception>
324+ /// <exception cref="LogicException "><paramref name="alias"/>别名冲突或者<paramref name="service"/>的绑定与实例都不存在</exception>
325325 /// <exception cref="ArgumentNullException"><paramref name="alias"/>,<paramref name="service"/>为<c>null</c>或者空字符串</exception>
326326 public IContainer Alias ( string alias , string service )
327327 {
@@ -330,7 +330,7 @@ public IContainer Alias(string alias, string service)
330330
331331 if ( alias == service )
332332 {
333- throw new RuntimeException ( $ "Alias is same as service name: [{ alias } ].") ;
333+ throw new LogicException ( $ "Alias is same as service name: [{ alias } ].") ;
334334 }
335335
336336 alias = FormatService ( alias ) ;
@@ -341,7 +341,7 @@ public IContainer Alias(string alias, string service)
341341 GuardFlushing ( ) ;
342342 if ( aliases . ContainsKey ( alias ) )
343343 {
344- throw new RuntimeException ( $ "Alias [{ alias } ] is already exists.") ;
344+ throw new LogicException ( $ "Alias [{ alias } ] is already exists.") ;
345345 }
346346
347347 if ( ! binds . ContainsKey ( service ) && ! instances . ContainsKey ( service ) )
@@ -414,7 +414,7 @@ public IBindData Bind(string service, Type concrete, bool isStatic)
414414 Guard . NotNull ( concrete , nameof ( concrete ) ) ;
415415 if ( IsUnableType ( concrete ) )
416416 {
417- throw new RuntimeException ( $ "Bind type [{ concrete } ] can not built") ;
417+ throw new LogicException ( $ "Bind type [{ concrete } ] can not built") ;
418418 }
419419 return Bind ( service , WrapperTypeBuilder ( service , concrete ) , isStatic ) ;
420420 }
@@ -426,7 +426,7 @@ public IBindData Bind(string service, Type concrete, bool isStatic)
426426 /// <param name="concrete">服务实现</param>
427427 /// <param name="isStatic">服务是否静态化</param>
428428 /// <returns>服务绑定数据</returns>
429- /// <exception cref="RuntimeException "><paramref name="service"/>绑定冲突</exception>
429+ /// <exception cref="LogicException "><paramref name="service"/>绑定冲突</exception>
430430 /// <exception cref="ArgumentNullException"><paramref name="concrete"/>为<c>null</c></exception>
431431 public IBindData Bind ( string service , Func < IContainer , object [ ] , object > concrete , bool isStatic )
432432 {
@@ -441,17 +441,17 @@ public IBindData Bind(string service, Func<IContainer, object[], object> concret
441441
442442 if ( binds . ContainsKey ( service ) )
443443 {
444- throw new RuntimeException ( $ "Bind [{ service } ] already exists.") ;
444+ throw new LogicException ( $ "Bind [{ service } ] already exists.") ;
445445 }
446446
447447 if ( instances . ContainsKey ( service ) )
448448 {
449- throw new RuntimeException ( $ "Instances [{ service } ] is already exists.") ;
449+ throw new LogicException ( $ "Instances [{ service } ] is already exists.") ;
450450 }
451451
452452 if ( aliases . ContainsKey ( service ) )
453453 {
454- throw new RuntimeException ( $ "Aliase [{ service } ] is already exists.") ;
454+ throw new LogicException ( $ "Aliase [{ service } ] is already exists.") ;
455455 }
456456
457457 var bindData = new BindData ( this , service , concrete , isStatic ) ;
@@ -550,7 +550,7 @@ public object Call(object target, MethodInfo methodInfo, params object[] userPar
550550 /// <param name="service">服务名或别名</param>
551551 /// <param name="userParams">用户传入的构造参数</param>
552552 /// <exception cref="ArgumentNullException"><paramref name="service"/>为<c>null</c>或者空字符串</exception>
553- /// <exception cref="RuntimeException ">出现循环依赖</exception>
553+ /// <exception cref="LogicException ">出现循环依赖</exception>
554554 /// <returns>服务实例,如果构造失败那么返回null</returns>
555555 public object Make ( string service , params object [ ] userParams )
556556 {
@@ -651,7 +651,7 @@ public void ClearExtenders(string service)
651651 /// <param name="service">服务名或别名</param>
652652 /// <param name="instance">服务实例,<c>null</c>也是合法的实例值</param>
653653 /// <exception cref="ArgumentNullException"><paramref name="service"/>为<c>null</c>或者空字符串</exception>
654- /// <exception cref="RuntimeException "><paramref name="service"/>的服务在绑定设置中不是静态的</exception>
654+ /// <exception cref="LogicException "><paramref name="service"/>的服务在绑定设置中不是静态的</exception>
655655 /// <returns>被修饰器处理后的新的实例</returns>
656656 public object Instance ( string service , object instance )
657657 {
@@ -669,7 +669,7 @@ public object Instance(string service, object instance)
669669 {
670670 if ( ! bindData . IsStatic )
671671 {
672- throw new RuntimeException ( $ "Service [{ service } ] is not Singleton(Static) Bind.") ;
672+ throw new LogicException ( $ "Service [{ service } ] is not Singleton(Static) Bind.") ;
673673 }
674674 instance = ( ( BindData ) bindData ) . TriggerResolving ( instance ) ;
675675 }
@@ -938,7 +938,7 @@ public void Flash(Action callback, params KeyValuePair<string, object>[] service
938938 // 所以我们抛出一个异常来终止该操作。
939939 if ( HasBind ( service . Key ) )
940940 {
941- throw new RuntimeException (
941+ throw new LogicException (
942942 $ "Flash service [{ service . Key } ] name has be used for { nameof ( Bind ) } or { nameof ( Alias ) } .") ;
943943 }
944944 }
@@ -1162,7 +1162,6 @@ protected virtual object ResloveAttrClass(Bindable makeServiceBindData, string s
11621162 {
11631163 return result ;
11641164 }
1165-
11661165 throw ;
11671166 }
11681167 }
@@ -1332,11 +1331,11 @@ protected virtual UnresolvableException MakeUnresolvablePrimitiveException(strin
13321331 /// </summary>
13331332 /// <param name="service">当前服务名</param>
13341333 /// <returns>运行时异常</returns>
1335- protected virtual RuntimeException MakeCircularDependencyException ( string service )
1334+ protected virtual LogicException MakeCircularDependencyException ( string service )
13361335 {
13371336 var message = $ "Circular dependency detected while for [{ service } ].";
13381337 message += GetBuildStackDebugMessage ( ) ;
1339- return new RuntimeException ( message ) ;
1338+ return new LogicException ( message ) ;
13401339 }
13411340
13421341 /// <summary>
@@ -1368,7 +1367,7 @@ protected virtual void GuardUserParamsCount(int count)
13681367 {
13691368 if ( count > 255 )
13701369 {
1371- throw new RuntimeException ( "Too many parameters , must be less or equal than 255" ) ;
1370+ throw new LogicException ( "Too many parameters , must be less or equal than 255" ) ;
13721371 }
13731372 }
13741373
@@ -1415,7 +1414,7 @@ protected virtual Type SpeculatedServiceType(string service)
14151414 /// <param name="makeServiceBindData">服务绑定数据</param>
14161415 /// <param name="makeServiceInstance">服务实例</param>
14171416 /// <returns>服务实例</returns>
1418- /// <exception cref="RuntimeException ">属性是必须的或者注入类型和需求类型不一致</exception>
1417+ /// <exception cref="LogicException ">属性是必须的或者注入类型和需求类型不一致</exception>
14191418 protected virtual void AttributeInject ( Bindable makeServiceBindData , object makeServiceInstance )
14201419 {
14211420 if ( makeServiceInstance == null )
@@ -1521,7 +1520,7 @@ protected virtual Func<ParameterInfo, object> GetParamsMatcher(ref object[] user
15211520 /// <param name="baseParams">服务实例的参数信息</param>
15221521 /// <param name="userParams">输入的构造参数列表</param>
15231522 /// <returns>服务所需参数的解决结果</returns>
1524- /// <exception cref="RuntimeException ">生成的实例类型和需求类型不一致</exception>
1523+ /// <exception cref="LogicException ">生成的实例类型和需求类型不一致</exception>
15251524 protected virtual object [ ] GetDependencies ( Bindable makeServiceBindData , ParameterInfo [ ] baseParams , object [ ] userParams )
15261525 {
15271526 if ( baseParams . Length <= 0 )
@@ -1813,7 +1812,7 @@ private BindData MakeEmptyBindData(string service)
18131812 /// <param name="userParams">用户传入的构造参数</param>
18141813 /// <returns>服务实例,如果构造失败那么返回null</returns>
18151814 /// <exception cref="ArgumentNullException"><paramref name="service"/>为<c>null</c>或者空字符串</exception>
1816- /// <exception cref="RuntimeException ">出现循环依赖</exception>
1815+ /// <exception cref="LogicException ">出现循环依赖</exception>
18171816 /// <exception cref="UnresolvableException">无法解决服务</exception>
18181817 /// <returns>服务实例</returns>
18191818 private object Resolve ( string service , params object [ ] userParams )
0 commit comments