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:
Ashish 2021-09-16 13:27:58 +05:30 committed by GitHub
parent 553a1d983e
commit 9238a208ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 10 deletions

View file

@ -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;
}
}