Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ServerErrorHandler #32

Merged
merged 3 commits into from
Sep 29, 2014
Merged

Add ServerErrorHandler #32

merged 3 commits into from
Sep 29, 2014

Conversation

komamitsu
Copy link
Member

No description provided.

Map<String, Object> data = new HashMap<String, Object>();
data.put("k3", "v3");
data.put("k4", "v4");
logger.log("test01", data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment here that says 'writing to the closed socket'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

@@ -132,4 +132,10 @@ public void finalize() {
public boolean isConnected() {
return sender != null && sender.isConnected();
}

public synchronized void setServerErrorHandler(ServerErrorHandler serverErrorHandler) {
if (sender != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing null handler is user error. Throw IllegalArgumentException here to notify the user that there is something wrong in the code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the users can clear the error handler they set before if they pass null. Should we create another API such as resetServerErrorHandler?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Please add removeXXXHandler (resetXXX sounds settings the handler again)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to set errorHandler instance to DefaultErrorHandler to avoid that the user fails to log an exception when (reset|remove)ErrorHandler is called. So reset sounds more appropriate to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reset to DefaultErrorHandler sounds good.

@xerial
Copy link
Contributor

xerial commented Sep 25, 2014

LGTM!

komamitsu added a commit that referenced this pull request Sep 29, 2014
@komamitsu komamitsu merged commit 5e3e69f into master Sep 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants