I have this code:
public void remote(final Backup backup) {
local(backup);
AsyncTask.execute(new Runnable() {
@Override
public void run() {
BackupSendInfo sendInfo = new BackupSendInfo()
.setFile(getLastBackup()) // <---
.setFileName(getBackupName(backup))
.setBackup(backup)
.setDeviceId(device)
.setApp(config.getAppName());
fileSender.send(sendInfo);
}
});
}
And this is getLastBackup
method signature:
private File getLastBackup() throws BackupException;
As you can see, it throws BackupException
, but I can't add throws BackuPException
delcaration in remote
method signature, because it is in another thread.
How should I manage this situation? I want remote
method to throws BackupException