mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
System: Configuration: Backups - catch php errors for GDrive, closes https://github.com/opnsense/core/issues/8135
This commit is contained in:
parent
ef8ed9cc26
commit
ec4924620d
@ -195,7 +195,7 @@ class Gdrive extends Base implements IBackupProvider
|
||||
(string)$config->system->remotebackup->GDriveEmail,
|
||||
(string)$config->system->remotebackup->GDriveP12key
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Error | \Exception $e) {
|
||||
syslog(LOG_ERR, "error connecting to Google Drive");
|
||||
return array();
|
||||
}
|
||||
@ -207,7 +207,7 @@ class Gdrive extends Base implements IBackupProvider
|
||||
// read filelist ({prefix}*.xml)
|
||||
try {
|
||||
$files = $client->listFiles((string)$config->system->remotebackup->GDriveFolderID);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Error | \Exception $e) {
|
||||
syslog(LOG_ERR, "error while fetching filelist from Google Drive");
|
||||
return array();
|
||||
}
|
||||
@ -240,7 +240,7 @@ class Gdrive extends Base implements IBackupProvider
|
||||
if ($bck_data == $confdata) {
|
||||
$target_filename = null;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Error | \Exception $e) {
|
||||
syslog(LOG_ERR, "unable to download " .
|
||||
$configfiles[array_keys($configfiles)[0]]->description . " from Google Drive (" . $e . ")");
|
||||
}
|
||||
@ -253,7 +253,7 @@ class Gdrive extends Base implements IBackupProvider
|
||||
$target_filename,
|
||||
$confdata_enc
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Error | \Exception $e) {
|
||||
syslog(LOG_ERR, "unable to upload " . $target_filename . " to Google Drive (" . $e . ")");
|
||||
return array();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user