mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 03:11:30 +00:00
Don't force crash in release mode (fixes #595).
This commit is contained in:
parent
c836da275a
commit
6a686cdb95
2 changed files with 10 additions and 4 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 6d280e7b6461d407c90f8706e348393c657e995f
|
||||
Subproject commit 668eb7c398c2e8d0b9f7beb319b7789681d7d89f
|
|
@ -9,6 +9,8 @@ import android.preference.PreferenceManager;
|
|||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.nutomic.syncthingandroid.BuildConfig;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -152,9 +154,13 @@ public class SyncthingRunnable implements Runnable {
|
|||
case 1:
|
||||
// fallthrough
|
||||
default:
|
||||
// Force crash if Syncthing exits with an error.
|
||||
throw new RuntimeException("Syncthing binary crashed with error code " +
|
||||
Integer.toString(ret) + ", output:\n" + mErrorLog);
|
||||
// Report Syncthing crashes, using Exception in debug mode or log in release mode.
|
||||
String message = "Syncthing binary crashed with error code " +
|
||||
Integer.toString(ret) + ", output:\n" + mErrorLog;
|
||||
if (BuildConfig.DEBUG)
|
||||
throw new RuntimeException(message);
|
||||
else
|
||||
Log.e(TAG, message);
|
||||
}
|
||||
} catch (IOException | InterruptedException e) {
|
||||
Log.e(TAG, "Failed to execute syncthing binary or read output", e);
|
||||
|
|
Loading…
Reference in a new issue