Skip to content

Commit

Permalink
update for the 0.3.0 version
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdista committed Jul 21, 2015
1 parent 1357be4 commit a8218e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
<a href="http://lambdista.github.io/try/apidocs/">API documentation</a> for this project.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.lambdista</groupId>
<artifactId>try</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
<packaging>jar</packaging>

<name>Try-Success-Failure for Java 8</name>
Expand Down

0 comments on commit a8218e0

Please sign in to comment.