Skip to content

Added Seam for custom exceptions

Compare
Choose a tag to compare
@LarsEckart LarsEckart released this 09 Dec 18:58
· 35 commits to master since this release

If you want to customize what error is thrown (#596) , you can now do the following:

// global 
private final Closeable oldGenerator = Approvals.settings().registerErrorGenerator((received, approved) -> new AssertionError("Custom message")))
try (AutoCloseable old = Approvals.settings()
    .registerErrorGenerator((received, approved) -> new AssertionError("Custom message")))
{
 ...
}