A Java library that enables functional interfaces to throw checked exceptions, simplifying error handling in functional programming.
Faux Pas is a Java library that simplifies error handling in functional programming by allowing functional interfaces to throw checked exceptions. It fixes the JDK's limitation where standard functional types like `Function` or `Supplier` cannot throw checked exceptions, reducing boilerplate and making functional code more expressive. The library provides throwing variants of all major functional interfaces and utilities for better exception handling with `CompletableFuture`.
Java developers using functional programming patterns (e.g., streams, lambdas, CompletableFuture) who need to handle checked exceptions cleanly without wrapping them in runtime exceptions.
Developers choose Faux Pas because it seamlessly integrates with Java's existing functional interfaces, requires no runtime dependencies beyond Java 8+, and reduces verbosity in error handling. Its utilities for `CompletableFuture` and try-with-resources alternatives offer practical solutions to common pain points in functional Java code.
A library that simplifies error handling for Functional Programming in Java
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a full set of throwing variants like ThrowingFunction that extend JDK interfaces, allowing checked exceptions to be thrown directly in lambdas without wrapping.
Seamlessly extends standard Java functional types, ensuring 100% compatibility and easy drop-in replacement for existing code.
Offers partially() and failedWith() methods that simplify exception handling in async code by automatically managing CompletionException wrapping and unwrapping, reducing boilerplate.
Provides a functional alternative to try-with-resources that avoids unreachable bytecode issues, improving accuracy with code coverage tools like JaCoCo.
Requires Lombok for compilation, which can complicate builds in environments that restrict annotation processing or prefer minimal dependencies.
Still in 0.x version, indicating potential for breaking changes and less stability compared to mature libraries, though it is used in production.
Relies on Lombok's @SneakyThrows to bypass checked exceptions, which some developers view as a hack that undermines Java's compile-time exception safety.