Skip to content

Commit

Permalink
[Java] Add the ability to query if CountedErrorHandler has been closed.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Feb 20, 2020
1 parent e6beacf commit 03cd644
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,21 @@ public void close()
isClosed = true;
}

/**
* Has this instance been closed.
*
* @return true if {@link #close()} has previously be called, otherwise false.
*/
public boolean isClosed()
{
return isClosed;
}

public void onError(final Throwable throwable)
{
if (isClosed)
{
throwable.printStackTrace();
throwable.printStackTrace(System.err);
}
else
{
Expand Down

0 comments on commit 03cd644

Please sign in to comment.