} catch (IOException e) {
throw new DropboxIOException(e);
} catch (ParseException e) {
if (DropboxServerException.isValidWithNullBody(response)) {
// We have something from Dropbox, but it's an error with no reason
throw new DropboxServerException(response);
} else {
// This is from Dropbox, and we shouldn't be getting it
throw new DropboxParseException(bin);
}
} catch (OutOfMemoryError e) {
throw new DropboxException(e);
} finally {
if (bin != null) {
try {
bin.close();
} catch (IOException e) {
}
}
}
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode != DropboxServerException._200_OK) {
if (statusCode == DropboxServerException._401_UNAUTHORIZED) {
throw new DropboxUnlinkedException();
} else {
throw new DropboxServerException(response, result);
}
}
return result;
}