From d8238797c6b2ce29e533fb28f5a791c46dfbe28f Mon Sep 17 00:00:00 2001 From: untidylamp <44341286+untidylamp@users.noreply.github.com> Date: Wed, 5 Dec 2018 17:33:22 -0500 Subject: [PATCH] catch Matrix onLogin errors Catch Matrix errors login and network errors --- .../main/java/eu/droogers/smsmatrix/Matrix.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/src/main/java/eu/droogers/smsmatrix/Matrix.java b/app/src/main/java/eu/droogers/smsmatrix/Matrix.java index b251858..321cbbf 100644 --- a/app/src/main/java/eu/droogers/smsmatrix/Matrix.java +++ b/app/src/main/java/eu/droogers/smsmatrix/Matrix.java @@ -28,6 +28,7 @@ import org.matrix.androidsdk.listeners.MXMediaUploadListener; import org.matrix.androidsdk.rest.callback.SimpleApiCallback; import org.matrix.androidsdk.rest.client.LoginRestClient; import org.matrix.androidsdk.rest.model.Event; +import org.matrix.androidsdk.rest.model.MatrixError; import org.matrix.androidsdk.rest.model.Message; import org.matrix.androidsdk.rest.model.login.Credentials; @@ -90,6 +91,21 @@ public class Matrix { super.onSuccess(credentials); onLogin(credentials); } + + @Override + public void onMatrixError(MatrixError e) { + Log.e(TAG, "onLogin MatrixError" + e); + } + + @Override + public void onNetworkError(Exception e) { + Log.e(TAG, "onLogin Network error" + e); + } + + @Override + public void onUnexpectedError(Exception e) { + Log.e(TAG, "onLogin Unexpected error" + e); + } }); }