show full error messages from UpdateService
The "cause" is the Exception that was caught and embedded into the UpdateException, so it has more info on what happened.
This commit is contained in:
parent
ad3fd26756
commit
f0158063fb
@ -1129,8 +1129,21 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
||||
private final BroadcastReceiver repoUpdateReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
setUpConnectingProgressText(intent.getStringExtra(UpdateService.EXTRA_MESSAGE));
|
||||
String message = intent.getStringExtra(UpdateService.EXTRA_MESSAGE);
|
||||
if (message == null) {
|
||||
CharSequence[] repoErrors = intent.getCharSequenceArrayExtra(UpdateService.EXTRA_REPO_ERRORS);
|
||||
if (repoErrors != null) {
|
||||
StringBuilder msgBuilder = new StringBuilder();
|
||||
for (CharSequence error : repoErrors) {
|
||||
if (msgBuilder.length() > 0) {
|
||||
msgBuilder.append(" + ");
|
||||
}
|
||||
msgBuilder.append(error);
|
||||
}
|
||||
message = msgBuilder.toString();
|
||||
}
|
||||
}
|
||||
setUpConnectingProgressText(message);
|
||||
|
||||
ProgressBar progressBar = container.findViewById(R.id.progress_bar);
|
||||
Button tryAgainButton = container.findViewById(R.id.try_again);
|
||||
|
@ -487,7 +487,12 @@ public class UpdateService extends JobIntentService {
|
||||
}
|
||||
} catch (IndexUpdater.UpdateException e) {
|
||||
errorRepos++;
|
||||
repoErrors.add(e.getLocalizedMessage());
|
||||
Throwable cause = e.getCause();
|
||||
if (cause == null) {
|
||||
repoErrors.add(e.getLocalizedMessage());
|
||||
} else {
|
||||
repoErrors.add(e.getLocalizedMessage() + " ⇨ " + cause.getLocalizedMessage());
|
||||
}
|
||||
Log.e(TAG, "Error updating repository " + repo.address);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user