Unverified Commit 61707e2d authored by Leonardo Aramaki's avatar Leonardo Aramaki Committed by GitHub

Merge pull request #584 from RocketChat/fix/crash

Fix connect timeout crash
parents 2066f29c c26cb152
......@@ -20,8 +20,8 @@ android {
applicationId "chat.rocket.android"
minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 53
versionName "1.0.30"
versionCode 54
versionName "1.0.31"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
......
......@@ -7,8 +7,8 @@ import android.support.v7.app.AppCompatDelegate;
import com.crashlytics.android.Crashlytics;
import java.util.List;
import java.util.concurrent.TimeoutException;
import chat.rocket.android.helper.Logger;
import chat.rocket.android.helper.OkHttpHelper;
import chat.rocket.android.service.ConnectivityManager;
import chat.rocket.android.widget.RocketChatWidgets;
......@@ -54,13 +54,10 @@ public class RocketChatApplication extends MultiDexApplication {
if (e instanceof UndeliverableException) {
e = e.getCause();
}
if (e instanceof TimeoutException) {
// Some work timed-out after a server change is most probable.
return;
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
Thread.currentThread().getUncaughtExceptionHandler()
.uncaughtException(Thread.currentThread(), e);
Logger.report(e);
});
instance = this;
......
......@@ -114,6 +114,8 @@ public class MethodCallHelper {
return Task.forError(new Exception(errMessage));
} else if (exception instanceof DDPClientCallback.RPC.Timeout) {
return Task.forError(new MethodCall.Timeout());
} else if (exception instanceof DDPClientCallback.Closed) {
return Task.forError(new Exception("Oops, your connection seems off..."));
} else {
return Task.forError(exception);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment