我有以下Kotlin代码: fun getAdminUser(): User {} 如果getAllUsers()没有与指定谓词匹配的元素,它将抛出NoSuchElementException。我对这个异常很满意,但我想覆盖异常消息,以便在它失败时提供更多的上下文。在没有try-catch的Kotli
如何创建一个自定义的异常,它包装了三个不同的异常,如InvalidContextException,IllegalArgumentException。IllegalArgumentException, //Body of the method我想通过创建一个自定义异常来处理InstantiationException