Defines exception types to be considered "unchecked" by NX.
May be applied to checked exception-throwing expressions to assert that the given exception is not thrown.
The UncheckedExceptions annotation disables NX exception checking within the given method or class.
Checked exception configurations supported by NX.
Assert that the given checked exception T
is not thrown by expr
, excluding T
from checked exception validation
within.
Assert that the given checked exception T
is not thrown by expr
, excluding T
from checked exception validation
within.
Example usage:
val result = assertNoThrows[UnknownHostException](java.net.InetAddress.getByName("127.0.0.1"))
If the exception is thrown, it will be wrapped in a java.lang.AssertionError
and rethrown.
The exception type to be asserted.
A new NonThrowAssertion instance that may be applied to a checked exception throwing expression.
Scan expr
for unhandled exception errors.
Scan expr
for unhandled exception errors. Compiler errors will be triggered for any unhandled exceptions.
The expression type.
The checked exception configuration to be used when scanning expr
.
The expression to be scanned.
The expression result, or a compiler error if the expression contained unchecked exceptions.
Scan expr
for unhandled exception errors.
Scan expr
for unhandled exception errors. Compiler errors will be triggered for any unhandled exceptions.
The expression type.
The expression to be scanned.
The expression result, or a compiler error if the expression contained unchecked exceptions.
Compile time exception validation