use of com.dropbox.core.v2.files.DownloadErrorException in project keepass2android by PhilippC.
the class DropboxV2Storage method convertException.
private Exception convertException(DbxException e) {
Log.d(TAG, "Exception of type " + e.getClass().getName() + ":" + e.getMessage());
if (InvalidAccessTokenException.class.isAssignableFrom(e.getClass())) {
Log.d(TAG, "LoggedIn=false (due to InvalidAccessTokenException)");
setLoggedIn(false);
clearKeys();
return new UserInteractionRequiredException("Unlinked from Dropbox! User must re-link.", e);
}
if (ListFolderErrorException.class.isAssignableFrom(e.getClass())) {
ListFolderErrorException listFolderErrorException = (ListFolderErrorException) e;
if (listFolderErrorException.errorValue.getPathValue().isNotFound())
return new FileNotFoundException(e.toString());
}
if (DownloadErrorException.class.isAssignableFrom(e.getClass())) {
DownloadErrorException downloadErrorException = (DownloadErrorException) e;
if (downloadErrorException.errorValue.getPathValue().isNotFound())
return new FileNotFoundException(e.toString());
}
if (GetMetadataErrorException.class.isAssignableFrom(e.getClass())) {
GetMetadataErrorException getMetadataErrorException = (GetMetadataErrorException) e;
if (getMetadataErrorException.errorValue.getPathValue().isNotFound())
return new FileNotFoundException(e.toString());
}
if (DeleteErrorException.class.isAssignableFrom(e.getClass())) {
DeleteErrorException deleteErrorException = (DeleteErrorException) e;
if (deleteErrorException.errorValue.getPathLookupValue().isNotFound())
return new FileNotFoundException(e.toString());
}
return e;
}
Aggregations