Merge pull request #211 from ultrasonic/fix-app-closes-on-error

Don't close app on background task error.
This commit is contained in:
Yahor Berdnikau 2018-07-15 10:29:35 +02:00 committed by GitHub
commit 17eb92c71b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -21,20 +21,17 @@ package org.moire.ultrasonic.util;
import android.app.Activity; import android.app.Activity;
import android.os.Handler; import android.os.Handler;
import android.util.Log; import android.util.Log;
import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParseException;
import org.moire.ultrasonic.R; import org.moire.ultrasonic.R;
import org.moire.ultrasonic.service.SubsonicRESTException; import org.moire.ultrasonic.service.SubsonicRESTException;
import org.moire.ultrasonic.subsonic.RestErrorMapper; import org.moire.ultrasonic.subsonic.RestErrorMapper;
import javax.net.ssl.SSLException;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.security.cert.CertPathValidatorException; import java.security.cert.CertPathValidatorException;
import java.security.cert.CertificateException; import java.security.cert.CertificateException;
import javax.net.ssl.SSLException;
/** /**
* @author Sindre Mehus * @author Sindre Mehus
*/ */
@ -70,7 +67,7 @@ public abstract class BackgroundTask<T> implements ProgressListener
protected void error(Throwable error) protected void error(Throwable error)
{ {
Log.w(TAG, String.format("Got exception: %s", error), error); Log.w(TAG, String.format("Got exception: %s", error), error);
new ErrorDialog(activity, getErrorMessage(error), true); new ErrorDialog(activity, getErrorMessage(error), false);
} }
protected String getErrorMessage(Throwable error) { protected String getErrorMessage(Throwable error) {