英文:
How to define arch rule to prohibit that classes catch specific exception types?
问题
抱歉,您提供的内容涉及技术领域的特定术语和代码示例,我将按照您的要求进行翻译,以下是翻译好的部分:
我希望我能够定义一个架构规则,禁止类捕获特定的异常类型。类似于以下规则:
noClasses()
.that()
.resideOutsideOfPackage("..repository..")
.should()
.catchExceptions()
.that()
.areAssignableTo(SQLException.class)
在ArchUnit中是否有实现这样的方法?
英文:
I wish I could define an arch rule prohibiting that classes catch a given exception type. Something like the rule below:
noClasses()
.that()
.resideOutsideOfPackage("..repository..")
.should()
.catchExceptions()
.that()
.areAssignableTo(SQLException.class)
Is there a way to do that in ArchUnit?
专注分享java语言的经验与见解,让所有开发者获益!
评论