mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 11:21:29 +00:00
Display toast if folder observer fails (fixes #326).
This commit is contained in:
parent
c69b37bc5c
commit
2ed6dac071
2 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,7 @@ import android.preference.PreferenceManager;
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.nutomic.syncthingandroid.R;
|
import com.nutomic.syncthingandroid.R;
|
||||||
import com.nutomic.syncthingandroid.activities.MainActivity;
|
import com.nutomic.syncthingandroid.activities.MainActivity;
|
||||||
|
@ -325,6 +326,12 @@ public class SyncthingService extends Service implements
|
||||||
mObservers.add(new FolderObserver(mApi, r));
|
mObservers.add(new FolderObserver(mApi, r));
|
||||||
} catch (FolderObserver.FolderNotExistingException e) {
|
} catch (FolderObserver.FolderNotExistingException e) {
|
||||||
Log.w(TAG, "Failed to add observer for folder", e);
|
Log.w(TAG, "Failed to add observer for folder", e);
|
||||||
|
} catch (StackOverflowError e) {
|
||||||
|
Log.w(TAG, "Failed to add folder observer", e);
|
||||||
|
Toast.makeText(SyncthingService.this,
|
||||||
|
R.string.toast_folder_observer_stack_overflow,
|
||||||
|
Toast.LENGTH_LONG)
|
||||||
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -393,6 +393,9 @@ Please report any problems you encounter via Github.</string>
|
||||||
<!-- Title of the notification shown while syncthing is running and enabled -->
|
<!-- Title of the notification shown while syncthing is running and enabled -->
|
||||||
<string name="syncthing_active">Syncthing is running</string>
|
<string name="syncthing_active">Syncthing is running</string>
|
||||||
|
|
||||||
|
<!-- Toast shown if folder observer fails to traverse a folder -->
|
||||||
|
<string name="toast_folder_observer_stack_overflow">Directory tree too deep. Check for cyclic symlinks</string>
|
||||||
|
|
||||||
<!-- RestApi -->
|
<!-- RestApi -->
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue