diff --git a/CREDITS.md b/CREDITS.md index 24679c8..bd61b32 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -1,4 +1,7 @@ -# Suggestions # +# Credits # + +* Thanks to [Gregor Trefs](https://github.com/gtrefs) for the suggestion about accepting `Throwable` types instead of +only `Exception` ones and for the implementation of the part that deals with `AutoCloseable` types. * Thanks to [SÅ‚awomir Nowak](https://github.com/slnowak) for the suggestion about having two versions of `get`--the checked and unchecked one--and for adapting the API to Java 7 using [Google Guava](https://github.com/google/guava). diff --git a/README.md b/README.md index 55bea11..b8ef577 100644 --- a/README.md +++ b/README.md @@ -248,11 +248,13 @@ objects will throw a `GetOfFailureException` which wraps the original `Exception unchecked you're not forced to handle it. However, if for some reason you need to deal with checked exceptions this API provides a further method, `checkedGet`, which may throw an `Exception` that must be handled. -As a final note, the original library traps `Throwable` objects. This means that it also handles errors which are -a subclass of `Error`. In general you should not catch `Error`s. As a matter of fact, the Java API describes `Error` -starting with the following definition: "An Error is a subclass of `Throwable` that indicates serious problems that -a reasonable application should not try to catch". For this reason I decided not to catch `Throwable`s but only -`Exception`s. +As a final note, the original library traps `Throwable` types and rethrows only `NonFatal` ones +which, in its opinion, are: `VirtualMachineError`, `ThreadDeath`, `InterruptedException`, `LinkageError` and +`ControlThrowable`. The latter belongs to Scala so Java has no counterpart. Previous versions +of this library didn't catch `Throwable` types but only `Exception` ones. From the 0.3.0 version on, +thanks to [Gregor Trefs](https://github.com/gtrefs) suggestion, I changed the implementation so that now it +catches all `Throwable` types. However it rethrows all `Error` types. From the Java API: "An `Error` is a subclass +of `Throwable` that indicates serious problems that a reasonable application should not try to catch". ## Javadoc ## API documentation for this project. diff --git a/pom.xml b/pom.xml index 6d622a3..a2d8cc3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.lambdista try - 0.2.0 + 0.3.0 jar Try-Success-Failure for Java 8