Enhance exception catching in NotesClient

This commit is contained in:
stefan-niedermann 2019-12-30 20:35:46 +01:00
parent 3ec96e29d0
commit 6c4b941a09

View file

@ -215,14 +215,10 @@ public class NotesClient {
Log.d(TAG, "ETag: " + etag + "; Last-Modified: " + lastModified + " (" + lastModified + ")");
// return these header fields since they should only be saved after successful processing the result!
return new ResponseData(result.toString(), etag, lastModified);
} catch(NextcloudApiNotRespondingException | NextcloudHttpRequestFailedException e) {
throw e;
} catch (Exception e) {
if(e instanceof NextcloudHttpRequestFailedException) {
throw (NextcloudHttpRequestFailedException) e;
} else if(e instanceof NextcloudApiNotRespondingException) {
throw (NextcloudApiNotRespondingException) e;
} else {
e.printStackTrace();
}
e.printStackTrace();
}
return null;
}