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 callback mechanism into LwM2mClientObserver for when the unexpected error occurred #941

Closed
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ void onDeregistrationFailure(ServerIdentity server, DeregisterRequest request, R
String errorMessage, Exception cause);

void onDeregistrationTimeout(ServerIdentity server, DeregisterRequest request);

// ============== Unexpected Error Handling =================

void onUnexpectedErrorOccurred(Throwable unexpectedError);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe onUnexpectedError is enough ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the advice, I've not had confidence in this honestly :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed at 16c6cb7

}
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,8 @@ public void onDeregistrationFailure(ServerIdentity server, DeregisterRequest req
@Override
public void onDeregistrationTimeout(ServerIdentity server, DeregisterRequest request) {
}

@Override
public void onUnexpectedErrorOccurred(Throwable unexpectedError) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,10 @@ public void onDeregistrationTimeout(ServerIdentity server, DeregisterRequest req
}
}

@Override
public void onUnexpectedErrorOccurred(Throwable unexpectedError) {
for (LwM2mClientObserver observer : observers) {
observer.onUnexpectedErrorOccurred(unexpectedError);
}
}
}