mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
Merge pull request #31969 from nextcloud/fix/user_migration-use-exceptions
Catch avatar export separately for better failure tracing
This commit is contained in:
commit
3ebf7d045a
1 changed files with 5 additions and 1 deletions
|
|
@ -77,7 +77,11 @@ class AccountMigrator implements IMigrator {
|
|||
try {
|
||||
$account = $this->accountManager->getAccount($user);
|
||||
$exportDestination->addFileContents(AccountMigrator::PATH_ACCOUNT_FILE, json_encode($account));
|
||||
} catch (Throwable $e) {
|
||||
throw new AccountMigratorException('Could not export account information', 0, $e);
|
||||
}
|
||||
|
||||
try {
|
||||
$avatar = $this->avatarManager->getAvatar($user->getUID());
|
||||
if ($avatar->isCustomAvatar()) {
|
||||
$avatarFile = $avatar->getFile(-1);
|
||||
|
|
@ -87,7 +91,7 @@ class AccountMigrator implements IMigrator {
|
|||
$exportDestination->addFileAsStream($exportPath, $avatarFile->read());
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
throw new AccountMigratorException('Could not export account information', 0, $e);
|
||||
throw new AccountMigratorException('Could not export avatar', 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue