diff --git a/apps/settings/lib/UserMigration/AccountMigrator.php b/apps/settings/lib/UserMigration/AccountMigrator.php index 32cf898f2bc55..7b60a101ceeb9 100644 --- a/apps/settings/lib/UserMigration/AccountMigrator.php +++ b/apps/settings/lib/UserMigration/AccountMigrator.php @@ -77,7 +77,11 @@ public function export(IUser $user, IExportDestination $exportDestination, Outpu 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 @@ public function export(IUser $user, IExportDestination $exportDestination, Outpu $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); } }