1
0
mirror of https://github.com/tijder/SmsMatrix.git synced 2024-10-27 18:24:01 +00:00

Catch sms to Matrix errors

Catch errors when sending messages to Matrix
This commit is contained in:
untidylamp 2018-12-05 18:14:14 -05:00
parent d8238797c6
commit 745c52c7d7

View File

@ -248,7 +248,24 @@ public class Matrix {
Message msg = new Message();
msg.body = body;
msg.msgtype = type;
session.getRoomsApiClient().sendMessage(String.valueOf(transaction), room.getRoomId(), msg, new SimpleApiCallback<Event>());
session.getRoomsApiClient().sendMessage(String.valueOf(transaction), room.getRoomId(), msg, new SimpleApiCallback<Event>() {
@Override
public void onSuccess(Event event) {
Log.i(TAG, "sendMessage success");
}
@Override
public void onMatrixError(MatrixError e) {
Log.e(TAG, "sendMessage MatrixError" + e);
}
@Override
public void onNetworkError(Exception e) {
Log.e(TAG, "sendMessage Network error" + e);
}
@Override
public void onUnexpectedError(Exception e) {
Log.e(TAG, "sendMessage Unexpected error" + e);
}
});
transaction++;
}