mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 13:23:58 +01:00
Fixes #4601 - 1. Handle possible exceptions in upload file from stash 2. Modify MWException, as error is nullable, update getTitle and getMessage to rever that (#4627)
This commit is contained in:
parent
553a1d983e
commit
9238a208ba
4 changed files with 25 additions and 10 deletions
|
|
@ -31,11 +31,20 @@ public class MwException extends RuntimeException {
|
|||
return error;
|
||||
}
|
||||
|
||||
@Nullable public String getTitle() {
|
||||
return error.getTitle();
|
||||
@Nullable
|
||||
public String getTitle() {
|
||||
if (error != null) {
|
||||
return error.getTitle();
|
||||
}
|
||||
return errors != null ? errors.get(0).getTitle() : null;
|
||||
}
|
||||
|
||||
@Override @Nullable public String getMessage() {
|
||||
return error.getDetails();
|
||||
@Override
|
||||
@Nullable
|
||||
public String getMessage() {
|
||||
if (error != null) {
|
||||
return error.getDetails();
|
||||
}
|
||||
return errors != null ? errors.get(0).getDetails() : null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue